Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

 myconnection = New OleDbConnection("provider=microsoft.ACE.OLEDB.12.0;data source=C:\Users\DELL\Documents\Visual Studio 2012\Projects\WindowsApplication9\WindowsApplication9\NIBM.accdb")



    myAdapter = New OleDbDataAdapter("select*from Driverdetails", myconnection)

    myAdapter.Fill(Ds, "Driverdetails")
    myconnection.Close()
    DataGridView1.DataSource = Ds
    DataGridView1.DataMember = "Driverdetails"



End Sub
 myconnection = New OleDbConnection("provider=microsoft.ACE.OLEDB.12.0;data source=C:\Users\DELL\Documents\Visual Studio 2012\Projects\WindowsApplication9\WindowsApplication9\NIBM.accdb")



    myAdapter = New OleDbDataAdapter("select*from Driverdetails", myconnection)

    myAdapter.Fill(Ds, "Driverdetails")
    myconnection.Close()
   ** DataGridView1.DataSource = Ds.Tables(tableName or index)**
    DataGridView1.DataMember = "Driverdetails"



End Sub

You need to Set the DataSource of the DataGridView to a particular table of the dataset

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.