Three one questions about releatie in MySQL with Visual Basic 2008.
How can i use Mydatapter1 over again and over agian (see code)?
So that i can fill three datasets
I want to fill three datasets with tree different tables and use them in my program

myCommand1.CommandText = "select * from table1"
myCommand1.Connection = myConn
myAdapter1.SelectCommand = myCommand1
myAdapter1.Fill(MyDataset1, "table1")
MyDataTable1 = MyDataset1.Tables("table1")
DataGridView1.DataSource = MyDataTable1

      
myCommand1.CommandText = "select * from table2"
myCommand1.Connection = myConn
myAdapter1.SelectCommand = myCommand1
myAdapter1.Fill(MyDataset2, "table2")
MyDataTable2 = MyDataset2.Tables("table2")
DataGridView2.DataSource = MyDataTable2

myCommand1.CommandText = "select * from table3"
myCommand1.Connection = myConn
myAdapter1.SelectCommand = myCommand1
myAdapter1.Fill(MyDataset3, "table3")
MyDataTable3 = MyDataset3.Tables("table3")
DataGridView3.DataSource = MyDataTable3
myCommand1.CommandText = "select * from table1"
myCommand1.Connection = myConn
myAdapter1.SelectCommand = myCommand1
myAdapter1.Fill(MyDataset1, "table1")
MyDataTable1 = MyDataset1.Tables("table1")
DataGridView1.DataSource = MyDataTable1

      
myCommand1.CommandText = "select * from table2"
myCommand1.Connection = myConn
myAdapter1.SelectCommand = myCommand1
myAdapter1.Fill(MyDataset1, "table2")
MyDataTable2 = MyDataset1.Tables("table2")
DataGridView2.DataSource = MyDataTable2

myCommand1.CommandText = "select * from table3"
myCommand1.Connection = myConn
myAdapter1.SelectCommand = myCommand1
myAdapter1.Fill(MyDataset1, "table3")
MyDataTable3 = MyDataset1.Tables("table3")
DataGridView3.DataSource = MyDataTable3

first globally create one data adapter that is

dim myadapter1 as DataAdapter 
''and whenever you want to use write in procedure
myAdpter1=new DataAdapter 
''after your code for first DataGridView
''at the end of 1 DataGridView write
myAdpter1.Close
myAdpter1=nothing 
''then further write
myAdpter1=new DataAdapter 
'' end so on.
This question has already been answered. Start a new discussion instead.