How to parse string to byte[] in silverlight4 [Resolved]

Posted by Kranthi under Silverlight on 3/8/2011 | Points: 10 | Views : 1633 | Status : [Member] | Replies : 1
i have Two textboxes for upload file the uploades file will be stored in Article Table the DataField is; article=varbinary(max); articleimage=varbinary(max) i Used the Following Coding For Store Data... in That i Want to Parse string To byte how can i parse the textbox input to byte[]
Article magazine = new Article();

magazinearticle.=(txtBook.Text);
magazine.articleimage = txtCover.Text;




Responses

Posted by: T.saravanan on: 3/8/2011 [Member] [MVP] Silver | Points: 50

Up
0
Down

Resolved
Hi,

Add the following code in your insert query (or) stored procedure...
Declare @sInput varchar(50)

Set @sInput = 'ABCDEFG'
Select Convert(VarBinary(Max),@sInput)


Try this..

Note: DataType 'Image' means there is no need conversion.Just pass Char value,its automatically store into binary value.


Thanks,
T.Saravanan

Kranthi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response