I have a field of File Type in my Entity. How can I upload file using WCF API?
I tried to create a new Entity Member and added the following attribute in the member attributes collection
Attribute att = new Attribute();
att.Identifier = new Identifier();
att.Identifier.Name = "Image";
att.Value = bytes;
In attribute value I tried to pass the bytes array of an image, also tried Encoding.ASCII.GetString(bytes); as attribute value, but none of them works.
With byte array i get the following exception "Conversion failed when converting the nvarchar value 'System.Byte' to data type int." and in case of ASCII string i get "A database error has occurred. Contact your system administrator." error.
There is lack of documentation and samples.
Please let me know if someone tried it out.
- 已编辑 dotnetcoder2011 2012年4月30日 13:04