Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hi,

I have a database field varbinary which I am retrieving in c# and storing in a list. on button click I am passing a authnum value and storing the value in val.

var authval = from authlt in lstarray
                          where authlt.AuthNum == authnum
                          select authlt.authLetter;



i tried opening a pdf by giving the authval to binary writer so that a new window in which pdf will appear. but its not working. it is asking me to give a byte array which i am unable to get from the string value.

is there a way to copy all the string char by char into byte array???
any other way to display pdf from the string?



any help is appreciated.
Posted

1 solution

Try:
C#
byte[] array = Encoding.UTF8.GetBytes("Hello world!");
 
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