C1Editor - Read and Save to/from a SQL Server table

Posted by: goran.gustafsson on 2 January 2024, 12:00 am EST

  • Posted 2 January 2024, 12:00 am EST

    I’ve just downloaded the latest NET 6,7,8 version of C1Editor (8.0.20233.631).and included in one of my WinForms projects. In this case I want to try this editor in a form where I can create todo-lists. I want to have the possibility of bullet-lists, different fonts, textcolors and pictures so I think this editor is perfect. But the question is how I can save the data in the editorto a field in my SQL Server record instead of to a file (and the reverse, read the data from the database and add to the editor). I have a varchar(MAX) field in my table to hold the data but I don’t know how to read/write from this source instead of from/to a file. Is it even possible?

    In the documentation I can only read about this: https://developer.mescius.com/componentone/docs/win/online-editor-net/saveandload.html

  • Posted 3 January 2024, 1:42 am EST

    Hi Göran,

    We are in discussions with the developers regarding this requirement. [Internal Tracking ID: C1WIN-31522]

    We will update you on this as soon as we hear back from them.

    Thanks & Regards,

    Aastha

  • Posted 3 January 2024, 1:58 am EST

    Thank you.

    I searched for a simple property like C1Editor1.Text = text or byte array or maybe C1Editor1.Content = text or byte array, but did not find any other than LoadDocument and SaveDocument.

    There is no way to use the existing LoadDocument/SaveDocument using a Stream to convert to/from text and then use that converted data in the field in my table in SQL Server? I tried to go around the problem by testing that for a bit but could not get it to work.

  • Posted 3 January 2024, 9:27 pm EST

    Hi Göran,

    Thanks for sharing your analysis.

    C1Editor has been recently ported to NET6/NET8. Since it’s still in the early stages, lacking some features.

    Your requirement can be achieved by establishing a connection with your SQL server database. Check out this link for reference: https://stackoverflow.com/questions/1345508/how-do-i-connect-to-a-sql-database-from-c . Once connected, you can perform CRUD operations in the SQL server.

    Query the info you want from the database and store it in a DataTable. Then, go through the DataRow(s) in this DataTable to save the fetched data in an array. We were thinking of using this array in C1Editor’s InsertList() function. You can see how to do that here: https://developer.mescius.com/componentone/docs/win/online-editor-net/editdocument.html#i-heading-edit-lists

    While working on this, we ran into an issue which we have reported to the developers. We’ll keep you posted on any updates from them.

    We appreciate your patience while we are working on this issue.

    Thanks & Regards,

    Aastha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels