[2008] Quick and easy question about the DataGridView control
I'm getting A first chance exception of type 'System.InvalidOperationException' occurred in System.Data.dll whenever I try to debug my program, and none of my data is showing up in my DataGridView controls. So far I've only used drag and drop components, so I have no idea what the problem is. I'm using an express edition and it's an access database. Whenever I use preview it shows all the data fine.
This is the code, if that helps:
Code:
Public Class Form1
Private Sub CustomerBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerBindingNavigatorSaveItem.Click
Me.Validate()
Me.CustomerBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.CustomerDataSet)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'CustomerDataSet.Order' table. You can move, or remove it, as needed.
Me.OrderTableAdapter.Fill(Me.CustomerDataSet.Order)
'TODO: This line of code loads data into the 'CustomerDataSet.Customer' table. You can move, or remove it, as needed.
Me.CustomerTableAdapter.Fill(Me.CustomerDataSet.Customer)
End Sub
End Class
Re: [2008] Quick and easy question about the DataGridView control
Those Fill methods return the number of rows retrieved. Check that they aren't zero first of all.
Re: [2008] Quick and easy question about the DataGridView control
Fixed it. I had to change my compiler options since I'm running a 64 bit OS.