Click here to Skip to main content
15,895,988 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Frds,
I uploaded Word Document into SQL SERVER as Datatype varbinary(MAX)...
I need to display the text which is in that document...by fetching from SQL SERVER...
Display Text in Textbox...I am getting byte[] , but not able to convert into text...

by Suresh
Posted
Updated 16-Jun-12 0:48am
v2

1 solution

It may not help in your specific instance, but...

byte[] to string:
C#
byte[] bytes = ...
string s = System.Text.Encoding.ASCII.GetString(bytes);
The reason it may not help is that a Word file is not just text - there is a lot (and I do mean a lot) of extra information which describes how to display the text, among other stuff. What you get as a string will very probably not be directly displayable as text.
 
Share this answer
 
Comments
itsureshuk 16-Jun-12 7:54am    
ya its not working

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