What I am trying to do? update a database field with a richtextboxfield.
Please help.
I have tried using Dim range1 As New System.Windows.Documents.TextRange(RichTextBox1.Document.ContentStart, RichTextBox1.Document.ContentEnd)
but this did not work for me either.
Dim cnn As SqlConnection
Dim connectionString As String
connectionString = "Integrated Security=SSPI;Initial Catalog=rploperations;Data Source=" & Environment.MachineName.ToString
cnn = New SqlConnection(connectionString)
cnn.Open()
Dim CMD As New SqlCommand
CMD.Connection = cnn
Dim esgnotes As String
esgnotes = textbox1.text '''''I want to change to Richtextbox1.text(but this does not exist)
MsgBox(esgnotes)
CMD.CommandText = "Update [rplESGnotes] set notes = " & "'" & esgnotes & "'"
CMD.ExecuteNonQuery()
MsgBox(ComboBox1.Items(ComboBox1.SelectedIndex).ToString() & " has been updated")