0

hi,
i have a rich text box in my application and a save button.Can anyone tell me how to send that text from rich text box to database .Thanks

2
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by sdhawan
0

You can do it like this:

SqlCommand cmd = new SqlCommand("INSERT INTO table (richTxt) VALUES('" + richTextBox1.Text + "')");

cmd.ExecuteNonQuery();

Thanks

0

thanks .One more question, do u know how to include picture or image in rich text box and when u click on the image it should take u to paint.
Thanks alot for help

0

i know how to add image but how can i open paint when i click on it.Thanks

Edited by sdhawan: wrong info

0

Save the image somewhere and then use Process.Start() to open Paint.

Here's an example:

string imagePath = @"C:\image.jpg";

// This will open the image in Paint
System.Diagnostics.Process.Start("mspaint", imagePath");

Thanks

Edited by farooqaaa: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.