List:MySQL on Win32« Previous MessageNext Message »
From:Vic Spainhower Date:December 22 2013 4:10pm
Subject:Invalid File Format after update for rich text data
View as plain text  
Hello,


I hope this is the right mysql list, but I have a MySQL database which
contains fields that are richtext.  However after updates to the data, I am
unable to retrieve the data without getting the error "file format is not
valid".  The MySQL datatype is defined as text.

This is the code I'm using to update the database:

            Try
                Dim result As DialogResult = MessageBox.Show("Do you want to
save your changes?", "Update Confirm", MessageBoxButtons.YesNo,
MessageBoxIcon.Question)

                If result = DialogResult.Yes Then
                    Dim strSQL As String = "UPDATE tblIntroduction SET
introText = " & Chr(34) & Me.RTB1.Rtf & Chr(34) _
                                           & " WHERE FacilityID = " &
Globals.gdFacilityID
                    Dim myConnection As New
MySqlConnection(Globals.g_strConnectionString)
                    Dim myCommand As New MySqlCommand(strSQL, myConnection)
                    Dim rc As Integer
                    myConnection.Open()
                    myCommand = New MySqlCommand(strSQL, myConnection)
                    rc = myCommand.ExecuteNonQuery()
                    myCommand.Connection.Close()
                    myConnection.Close()
                    MsgBox("Changes were Saved!")
                Else
                    Exit Sub
                End If

            Catch ex As Exception

                MsgBox("Update Error, details: " & vbCrLf & ex.ToString)
            End Try


Thank you very much,

Vic

Thread
Invalid File Format after update for rich text dataVic Spainhower22 Dec
RE: Invalid File Format after update for rich text dataLeif Johnston22 Dec