excel file attachment

Discussion in 'ASP .Net' started by =?Utf-8?B?RGFuaWVs?=, Aug 18, 2005.

  1. Hi,

    i have problem in attaching excel file and store into sqldatabase.
    have any ideas?

    I'm totally new to this ability.

    your help will be appreciated.
    thank you.

    Bset regards,
    Gin Lye Khor
    =?Utf-8?B?RGFuaWVs?=, Aug 18, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?RGFuaWVs?=

    Paul Clement Guest

    Paul Clement, Aug 18, 2005
    #2
    1. Advertising

  3. Hi Daniel,

    If you want to save data in the excel file, please look at following URL:
    http://msdn.microsoft.com/library/d...tskcodeexamplereadingexceldataintodataset.asp

    Or if you want to save the excel file to DB, take look at
    http://support.microsoft.com/default.aspx?scid=kb;en-us;326502

    HTH

    Elton Wang




    "Daniel" wrote:

    > Hi,
    >
    > i have problem in attaching excel file and store into sqldatabase.
    > have any ideas?
    >
    > I'm totally new to this ability.
    >
    > your help will be appreciated.
    > thank you.
    >
    > Bset regards,
    > Gin Lye Khor
    =?Utf-8?B?RWx0b24gVw==?=, Aug 18, 2005
    #3
  4. Hi All,
    thanks for ur response.

    Now i know how to upload the file(excel format) but i have problem download
    the file and view it(excel format).

    after i save the file/ try to view the file(excel format) from sqldatabase,
    the file already corrupted.

    Here is my code:
    Function GetFile()

    Dim PROD_CONNEC As SqlConnection = New
    SqlConnection("Server=gl;uid=LBPCOS;pwd=new1;database=DB")
    Dim PROD_CMD As SqlCommand = New SqlCommand("wla_getfile",
    PROD_CONNEC)
    Dim PROD_DR As SqlDataReader

    PROD_CMD.CommandType = CommandType.StoredProcedure

    Dim PRM_CP As New SqlParameter("@Attachment_ID", SqlDbType.Int)
    PRM_CP.Value = CInt("1")
    PROD_CMD.Parameters.Add(PRM_CP)

    PROD_CONNEC.Open()
    PROD_DR = PROD_CMD.ExecuteReader


    If PROD_DR.Read Then
    Response.ContentType = PROD_DR("Contenttype").ToString
    Response.OutputStream.Write(CType(PROD_DR("Filedata"), Byte()),
    0, CInt(PROD_DR("Filesize")))
    Response.AddHeader("Content-Disposition", "attachment;filename="
    + PROD_DR("Filename").ToString())
    Else
    Response.Write("File Not Found.")
    End If

    PROD_CONNEC.Close()

    End Function

    Any ideas? I already out of ideas.
    thank you.

    best regards,
    GL

    "Paul Clement" wrote:

    > On Thu, 18 Aug 2005 02:46:42 -0700, Daniel <> wrote:
    >
    > ¤ Hi,
    > ¤
    > ¤ i have problem in attaching excel file and store into sqldatabase.
    > ¤ have any ideas?
    > ¤
    > ¤ I'm totally new to this ability.
    > ¤
    > ¤ your help will be appreciated.
    > ¤ thank you.
    >
    > See the following:
    >
    > http://www.codeproject.com/aspnet/fileupload.asp
    > http://steveorr.net/Articles/EasyUploads.aspx
    >
    >
    > Paul
    > ~~~~
    > Microsoft MVP (Visual Basic)
    >
    =?Utf-8?B?RGFuaWVs?=, Aug 18, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia
    Replies:
    1
    Views:
    1,363
    Carl Prothman [MVP]
    Jan 12, 2005
  2. Replies:
    1
    Views:
    1,773
    extentechjohn
    Nov 21, 2006
  3. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,478
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  4. gregarican
    Replies:
    1
    Views:
    145
    gregarican
    Jan 16, 2009
  5. p cooper
    Replies:
    1
    Views:
    791
    Ben Morrow
    Jan 31, 2004
Loading...

Share This Page