SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help me in displaying the attachment data

    m using c# asp.net 2.0 visual studio 2005 and database is oracle.


    select doc.Document_name,doc.document_ext from ims_document doc where doc.incident_id='TIC108'

    i m passing this query to display the data in hyperlink button.

    WHen the page loads at that time i want to fill the hyperlinkbutton with the name of document+ the extension of document

    while (reader.Read())
    {
    hyperlinkAttachment.Text = reader[0].ToString()

    }
    m writing this in page_load event.
    but getting only the name of document not extension.
    Suppose the name of document is srs and extension is .doc.
    then i want srs.doc as output in hyperlink button.
    what and where to write for this?

  2. #2
    SitePoint Mentor NightStalker-DNS's Avatar
    Join Date
    Jul 2004
    Location
    Cape Town, South Africa
    Posts
    2,880
    Mentioned
    48 Post(s)
    Tagged
    0 Thread(s)
    select (doc.Document_name + doc.document_ext) as fileName from ims_document doc where doc.incident_id='TIC108'

    or change to this:

    hyperlinkAttachment.Text = reader[0].ToString() + reader[1].ToString();

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NightStalker-DNS View Post
    select (doc.Document_name + doc.document_ext) as fileName from ims_document doc where doc.incident_id='TIC108'

    or change to this:

    hyperlinkAttachment.Text = reader[0].ToString() + reader[1].ToString();

    now it's displaying like this
    srsxls
    but not srs.xls
    how to get this?

  4. #4
    SitePoint Zealot
    Join Date
    Jan 2009
    Posts
    176
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    string docname = reader.GetString(0);
    string ext = reader.GetString(1);
    hyperlinkAttachment.Text = docname+"."+ ext;

    Is this correct?

  5. #5
    SitePoint Addict kunalraj's Avatar
    Join Date
    Nov 2008
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you are use

    hyperlinkAttachment.Text = reader[0].ToString() + reader[1].ToString();

    so for that you can write

    hyperlinkAttachment.Text = reader[0].ToString()+.+ reader[1].ToString();
    or

    hyperlinkAttachment.Text = reader[0].ToString()+"."+ reader[1].ToString();

    may be u get solution it is guess.

    thanks,
    kunalraj


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •