Click here to Skip to main content
15,888,208 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have created one WCF application and it has one service to save image in database. I have used image data type column in Data table. My WCF method is as follows:

C#
public string InsertImage(byte[] byteStream)
{
   string bb = System.Text.Encoding.ASCII.GetString(byteStream);
   byte[] encodedDataAsBytes= System.Convert.FromBase64String(bb);

   bool result = SiteImageDao.InsertImage(encodedDataAsBytes);
   var xResult = new XElement("Result", result);

   return xResult.ToString();


}

Can anyone tell me weather I am doing this correctly.

Thanks.
Posted
Updated 10-Jan-12 0:44am
v4
Comments
Slacker007 10-Jan-12 6:45am    
Edits made: formatting, title, and readability.

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