Hi everybody,
How can I upload and image and save it into SQL Server database using ADO.net and WCF service or webservice ?
I am working on a silverlight application . language is C#
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.
Wael MoulaPosted Mar 29, 2012, 11:15 AM
Krishna GaradPosted Mar 29, 2012, 8:55 AM
on right side of this post.
Wael MoulaPosted Mar 29, 2012, 8:17 AM
But have you a tutorial that shows everything ( the wcf service , the classes ... ) step by step
Gohil JayendrasinhPosted Mar 29, 2012, 8:05 AM
Uisng LINQ to SQL
protected void Button1_Click(object sender, EventArgs e)
{
if (FileUpload1.HasFile && FileUpload1.PostedFile.ContentLength > 0)
{
string fileName = FileUpload1.FileName;
byte[] fileByte = FileUpload1.FileBytes;
Binary binaryObj = new Binary(fileByte);
DataClasses1DataContext context = new DataClasses1DataContext();
context.ImageTables.InsertOnSubmit(
new ImageTable { Id = "xyz",
Name = fileName,
FileSource = binaryObj });
context.SubmitChanges();
}
}