hai,
i wish to know, how to insert the byte array file into a sql table and also is it possible to insert large files.
Thank you
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suthish NairPosted Jan 30, 2011, 1:21 PM
So other members can easily find the answers.
Krishna GaradPosted Jan 28, 2011, 1:32 AM
(
@data varbinary(max)
)
as
Insert statement
end
Convert byte file into byte array
byte[] _data;
private void PreapareByteArray()
{
if (FileUpload1.HasFile)
{
using (BinaryReader reader = new BinaryReader(FileUpload1.PostedFile.InputStream))
{
_data = reader.ReadBytes(FileUpload1.PostedFile.ContentLength);
}
}
}
Pass this _data to insert statement it will insert byte array to sql table.