1.11M Members

Data grid view loading multiple time.I want only one time loading

 
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
 
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

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: