Blob field from a Dataset in a datagrid
Posted on 2006-05-08
I have a blob field in my database that contains a large amount of string data and I need to bind that data to a datagrid
here is the code I am currently trying
Dim MySQLConnection1 As MySqlConnection
Dim MySQLDataAdapter1 As MySqlDataAdapter
Dim MySQLSelectCommand1 As MySqlCommand
Dim dsMine As DataSet
MySQLConnection1 = New MySqlConnection()
MySQLDataAdapter1 = New MySqlDataAdapter()
MySQLSelectCommand1 = New MySqlCommand()
MySQLConnection1.ConnectionString = "Server=Main;Database=Test;Uid=user;Pwd=password;"
MySQLSelectCommand1.Connection = MySQLConnection1
MySQLDataAdapter1.SelectCommand = MySQLSelectCommand1
MySQLSelectCommand1.CommandText = "SELECT blobfield FROM table"
dsMine = New DataSet()
DataGrid1.DataSource = dsMine
Catch ex As Exception
I know this is MySQL but it shouldnt matter where the dataset originates I need to take the data that is contained in the blob field and display it as a string in the Datagrid
If I insert a simple string into blobfield such as 'simplestring'
I cannot read that back, I get Byte.Array as the returned value no matter what is in the blob field data. Any help would be great, Thank you