I want to convert a binary to a string.(Database contains binary data stored.)
What writer to use(like StreamWriter)
Convert Binary to String C#
5 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Apr 15, 2011, 2:24 AM EDT
1.
Byte[] Bytearray = { c, s, k };
string sout = Convert.ToBase64String(Bytearray);
2.
string sout = "Chandra Sekhar K";
byte []Bytearray = System.Text.Encoding.ASCII.GetBytes(sout);
string sout1 = Convert.ToBase64String(Bytearray);
Suthish NairRank #92 · 22.8K reputationPosted Apr 15, 2011, 6:40 AM EDT
Chandra Sekhar K160 reputationPosted Apr 17, 2011, 10:04 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Apr 18, 2011, 10:00 AM EDT
Sam HobbsRank #108 · 20.5K reputationPosted Apr 18, 2011, 6:54 PM EDT