Hi - I've been trying to search on this question but I can't find anything that matches what I'm trying to do
Basically using Visual web gui controls (for .NET 2.0 build 6.1.4)
I have a number of tabs on a form with a DataGrid which is connected to BindingSource1
BindingSource1 is connected to a dataset which I set up to have a number of tables / table adapters from one database.
What happens on the "TabControl1_SelectedIndexChanged" is that it selects the case of the tab index and based on this repopulates the Datagrid with a different table adapter.
EG:
This is working perfectly, but now I want to add a 2nd dataset which points to tables on another database.
I have added radio buttons and when clicking on them I want to say something like:
MaintDataSet1.DataSetName = DataSet2
and then set the
BindingSource1 = OtherTableAdapter.Fill(MaintDataSet1.OtherTable) ....
But it doesn't work, I'm not even sure if this is the correct way to do it?
Can anyone advise? Thanks.
Basically using Visual web gui controls (for .NET 2.0 build 6.1.4)
I have a number of tabs on a form with a DataGrid which is connected to BindingSource1
BindingSource1 is connected to a dataset which I set up to have a number of tables / table adapters from one database.
What happens on the "TabControl1_SelectedIndexChanged" is that it selects the case of the tab index and based on this repopulates the Datagrid with a different table adapter.
EG:
VB.NET:
Case 1
BindingSource1.DataMember = "Speciality1"
Speciality1TableAdapter1.Fill(MaintDataSet1.Speciality1)
Case 2
BindingSource1.DataMember = "Users"
UsersTableAdapter1.Fill(MaintDataSet1.Users)
Case (etc.)
This is working perfectly, but now I want to add a 2nd dataset which points to tables on another database.
I have added radio buttons and when clicking on them I want to say something like:
MaintDataSet1.DataSetName = DataSet2
and then set the
BindingSource1 = OtherTableAdapter.Fill(MaintDataSet1.OtherTable) ....
But it doesn't work, I'm not even sure if this is the correct way to do it?
Can anyone advise? Thanks.
Last edited: