TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
nitin 0
NA
18
0
Cannot display byte arrays in Rich Text Box Please help
Jan 8 2004 10:56 AM
Hi ALL, I want to display in a RichTextBox the Binary Large Objects data coming from database. If I have one record its not a problem I convert it to byte array and pass it on in a stream as a byte array and then call Loadfile method of RichTextBox and pass the stream. This works BUT IF I have more records I have to create a loop and some how pass the concatenated byte array and then pass it in a stream. I do this with following code but when I see the RichTextBox I can see only one Record and not all the records retrieved from database, I think reason is the that in the stream all different byte arrays have start and end header and stream shows only till the point it sees end header of first record. Please help am i moving in right direction or is there any other solution. Your reply would be highly appreciated. Thanks a lot. Here is the code for reference private void ShowPaketRtfText(long lngPaketID, string strSprachID) { byte[] binaryData=null; DataSet PaketSet = oService.GetPaketTextBlocks(lngPaketID,strSprachID); DataTable dataTable = PaketSet.Tables[0]; ArrayList pobjCombinedArrays = new ArrayList(); foreach(DataRow Row in dataTable.Rows) { binaryData = (byte[])Row["VERSION_TEXT"]; pobjCombinedArrays.AddRange(binaryData); } byte[] pbytCombinedArrays = new byte[pobjCombinedArrays.Count]; pobjCombinedArrays.CopyTo(pbytCombinedArrays); System.IO.MemoryStream stream = new System.IO.MemoryStream(pbytCombinedArrays); RTFTextBlock.LoadFile(stream, RichTextBoxStreamType.RichText); }
Reply
Answers (
1
)
ASP using COM-object error "Object reference not set to an instance of an object"
What is the lifetime of singleton server in remoting