Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi,
i am using asp.net 4.0 backend is sqlserver2008, and i stored image in the data base table as binary format. now i want to retrieve it using wcf and linq to sql concept.
how to do it. can anyone help me in my requirement.
Posted

Quote:
i think you have used
foreach (DataRow dr in dt.Rows)
{
if (dr != null)
{
byte[] byt = (byte[])dr[2];
string str;
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
str = enc.GetString(byt);
dr[4] = str;
}
}
for saving the image as binary.
so you can use the opposite way to get the image.
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
abl.packageDescription = encoding.GetBytes(Editor1.Content);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900