Click here to Skip to main content
16,012,173 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
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 well
Posted
Comments
Sergey Alexandrovich Kryukov 10-Jan-12 13:29pm    
The Dao known to be good or bad is not a true Dao... :-)
--SA

1 solution

Where did you initialize your WCFClient Object?

Is SiteImageDao your Wcf Client object?
if yes ,write
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);
SiteimageDao.Close();
return xResult.ToString();


}
 
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