0

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

Edited by sachintha: DATA GRID view load multiple times when i click the button view!!!i want only one time loading

2
Contributors
1
Reply
9
Views
3 Years
Discussion Span
Last Post by kRod
0
 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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.