How to upload file to SQL Server for Bulk Insert?

Discussion in 'ASP .Net' started by ABC, May 11, 2006.

  1. ABC

    ABC Guest

    Our environment has two servers, one is web and another is SQL Server. I
    can write upload file to IIS. But, I cannot call SQL Server's BULK Insert
    statement.

    Is there any idea to handle this case?
     
    ABC, May 11, 2006
    #1
    1. Advertising

  2. ABC

    Galin iliev Guest

    you canread content with FileUpload class

    byte[] fileContent = new byte[FileUpload.PostedFile.ContentLength];

    string sFileName =
    System.IO.Path.GetFileName(FileUpload.PostedFile.FileName);

    FileUpload.PostedFile.InputStream.Read(fileContent, 0,
    FileUpload.PostedFile.ContentLength);

    and then save it to database with insert query (use image for SQL column
    type )

    Hope this helps
    --
    Galin Iliev [MCSD, MCSD.NET]
    Senior Software Developer
    www.wordassist.com

    "ABC" <> wrote in message
    news:...
    > Our environment has two servers, one is web and another is SQL Server. I
    > can write upload file to IIS. But, I cannot call SQL Server's BULK Insert
    > statement.
    >
    > Is there any idea to handle this case?
    >
     
    Galin iliev, May 11, 2006
    #2
    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. Sean
    Replies:
    6
    Views:
    419
  2. Azkaban

    Bulk upload like SPPS 2003

    Azkaban, Jun 18, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    375
    John Timney \(Microsoft MVP\)
    Jun 18, 2004
  3. =?Utf-8?B?U2hpanUgUG95aWxpbA==?=

    BULK INSERT WITH ADO.NET & ORACLE

    =?Utf-8?B?U2hpanUgUG95aWxpbA==?=, Apr 25, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    6,334
    Sathya.Pai
    Sep 9, 2009
  4. planetmatt

    Bulk Insert to SQL Server from ASP.NET

    planetmatt, Nov 10, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,089
    sloan
    Nov 10, 2006
  5. AB@
    Replies:
    2
    Views:
    1,457
Loading...

Share This Page