Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am working on windows form application with C# .
I want to store the quadratic formula and some text through richTextBox in the MS Access Database.
And then show as same in the datagridview.
How can I store this formula and text in ms access database and then again retrieve on the datagridview as same?

What I have tried:

i have tried this article on stackoverflow,code project and msdn.
Posted
Updated 6-Jun-19 21:24pm

1 solution

Storing it is pretty simple: I assume you have it a a rich text document in your RichTextBox and that you want to "keep the formatting"? If so, then that part is simple: get the RTF data from the RichRextBox using the Rtf property:
C#
string rtf = myRichTextBox.Rtf;
Once it's in a string, you can store it a database like any other string based data.
Displaying RTF data in a DataGridView is harder though, but not impossible: RichTextBox Cell in a DataGridView[^] should help.
 
Share this answer
 
Comments
Member 14484233 7-Jun-19 10:02am    
Very thanks.
OriginalGriff 7-Jun-19 10:14am    
You're welcome!

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