Exception in the DataGridView for a BLOB field in .Net 2008


R

Ryan

I am trying to hide a coloumn if the DataType is Byte (Byte[]) but still get
the exception; how do I either hide this field or not add to the DataGridView?
the following exception occured in the DataGridView:
system.argumentexception:parameter is not valid

Dim oAdapter As OracleDataAdapter
oAdapter = New OracleDataAdapter(sSQL, oConn)
myDataSet = New DataSet()
oAdapter.Fill(myDataSet)

myBindingSource = New BindingSource()
myBindingSource.DataSource = myDataSet

With myDataSet.Tables(0)
For i As Integer = 0 To myDataSet.Tables(0).Columns.Count - 1
If InStr(.Columns(i).DataType.ToString, GetType(Byte).ToString) > 0
Then
myDataSet.Tables(0).Columns(i).ColumnMapping = MappingType.Hidden
End If
Next
End With

DataGridView1.DataSource = myDataSet.Tables(0)
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top