I am having a problem.
I am filling a datagridview straight from an oracle sql query.
The datagridview is filling properly using this code.
Try cmd.CommandText = "SELECT *" & _ "FROM oracle database Dim da As New OracleDataAdapter(cmd) Dim DMdt As New DataTable da.Fill(DMdt) If DMdt.Rows.Count > 0 Then Me.DataGridView1.DataSource = DMdt 'filter the datatable da.Dispose()
I then add a column to the datagridview
Dim cbPart As New DataGridViewCheckBoxColumn DataGridView1.Columns.Insert(1, cbPart) With cbPart .HeaderText = "Part" .Name = "Part" .DisplayIndex = 10 .Frozen = False End With
The column shows up just fine. However here is when I call a parsing sub to check each box when certain part formats are met. The parsing is working fine in debugging but when a value is true it is throwing an exception.
'do all parsing 'if conditions are met then CType(DataGridView1.DataSource, DataTable).Rows(i).Item("Part") = True count = count + 1
The error I am getting is stating that the Part column I am creating does not belong to the table. However it is showing up in the datagridview.
Any help would be appreciated.