Public Sub UploadSqlText(ByVal myConnection As MySqlConnection)
myConnection.Unicode = True
Dim myTextSql As MySqlText = New MySqlText("This is a test text block")
Dim myCommand As MySqlCommand = New MySqlCommand("INSERT INTO Test.TextBlocks (BlockID, BlockName, BlockContent) VALUES(3,'First',:BlockText)", myConnection)
myCommand.Parameters.Add("BlockText", myTextSql)
myConnection.Open()
Try
Console.WriteLine(String.Concat(myCommand.ExecuteNonQuery(), " rows affected."))
Finally
myConnection.Close()
End Try
End Sub
Public Sub DownloadSqlText(ByVal myConnection As MySqlConnection)
myConnection.Unicode = True
Dim myCommand As New MySqlCommand("SELECT * FROM Test.TextBlocks", myConnection)
myConnection.Open()
Dim myReader As MySqlDataReader = myCommand.ExecuteReader(CommandBehavior.Default)
Try
While myReader.Read()
Dim myTextSql As MySqlText = myReader.GetMySqlText(myReader.GetOrdinal("BlockContent"))
If Not myTextSql.IsNull Then
Console.WriteLine(myTextSql.Value)
End If
End While
Finally
myReader.Close()
myConnection.Close()
End Try
End Sub