3
Answers

How to parse string to byte[] in silverlight4

anitha r

anitha r

14y
5k
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;
Answers (3)
0
Suthish Nair

Suthish Nair

NA 31.7k 4.6m 14y
thread resolved?
0
Vulpes

Vulpes

NA 98.3k 1.5m 14y
If you're asking how to convert the string which is already displayed in the textbox to a byte array, then try:

byte[] bytes = Encoding.Unicode.GetBytes(txtBook.Text);
0
Krishna Garad

Krishna Garad

NA 16.5k 6.2m 14y
first you have to read file in byte array and then store it in table as usual. For converting file to byte array check out the articles one of the link to do in asp.net
http://www.c-sharpcorner.com/UploadFile/krishnasarala/5513/?ArticleID=45b6575c-0677-4029-bc97-4893a85bcd43