We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Saving stream to database

Thread ID:

Created:

Updated:

Platform:

Replies:

43827 May 4,2006 04:47 PM UTC May 8,2006 05:05 PM UTC WinForms 2
loading
Tags: EditControl
James
Asked On May 4, 2006 04:47 PM UTC

Hi, Has anyone managed to use the SaveToStream method to save to a sql server database. I can output the stream but each line with a carriage return on it seems to have 256 bytes padded with 0x0 and when the document is read back in from the db these are shown as little squares! Any ideas?

Administrator [Syncfusion]
Replied On May 5, 2006 01:59 PM UTC

Hi James, Your Direct-Trac incident 25303 in this regard has been updated. Please refer to my response there and let me know if you need any other information. We appreciate your interest in Essential Edit. Regards, Ebenezer.P

James
Replied On May 8, 2006 05:05 PM UTC

OK - for any of you wanting to know the solution here it is. This is now working thanks on part to the help of the tech support guys. To Save the contents of an editControl :- byte[] b = null; ASCIIEncoding ae = new ASCIIEncoding(); b = ae.GetBytes(this.editControl1.Text); I can then assign the value of b directly to my parameter in my stored procedure (which is sql sever "image" type). To restore the contents :- System.Data.SqlClient.SqlDataReader MyReader = cmdOpenMacro.ExecuteReader(CommandBehavior.CloseConnection); if (MyReader.Read()) { Stream s = new MemoryStream((byte[])MyReader.GetValue(0)); editControl1.LoadStream(s, editControl1.Configurator[ "MyLanguage" ]); } Hope that helps anyone else struggling with this one! Cheers. James.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;