Results 1 to 3 of 3

Thread: [2008] Quick and easy question about the DataGridView control

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    9

    [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

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    9

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width