How to upload file to SQL Server for Bulk Insert?

A

ABC

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?
 
G

Galin iliev

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top