Ok, I'm new to .NET, but not new to VB. But its been since VB5...so I'm rusty and crusty. What I'm trying to do used to take me minutes, now I'm just stumped over the simplest crap.
Background:
I have a form with a couple of text boxes, a datepicker control, a combobox and a datagrid. I have a SQL db with 3 tables in it. A Master, a detail and a 'site' table.
The datagrid is bound to the detail table via a DataSet. I just clicked in the empty 'Data Sources' tab/explorer and went to town...now I'm not convinced that I went the right route. I used to just code all the db stuff by hand, but I'd like to learn the new stuff.
So at the bottom of the designer, I have a DataSet, 3 table adapters, 3 binding sources and only one binding navigator for the detail table.
Anyway, datagrid is connected to the detail table. All of the other controls on the form are connected to the master table via the same method except for the combo box which only contains the 3 records from the Site table.
Ok, so the form opens, you fill in the boxes, then go down to the data grid to fill in the 3 fields that are visible, then you're done (commit changes to master and detail recordsets) or you add another detail record (tied to the same master record). The problem is that there is a field in the datagrid that I don't have visible which is the MasterID that I use to tie these detail records to the correct record in the Master table.
The Actual Question:
So, how do I set/edit the MasterID field value of the current row (detail table) in the datagrid = the MasterID field value of the currently selected record of the Master table?
I realize I'm probably using the term 'table' incorrectly since I'm dealing with a dataset...old habbits...
Background:
I have a form with a couple of text boxes, a datepicker control, a combobox and a datagrid. I have a SQL db with 3 tables in it. A Master, a detail and a 'site' table.
The datagrid is bound to the detail table via a DataSet. I just clicked in the empty 'Data Sources' tab/explorer and went to town...now I'm not convinced that I went the right route. I used to just code all the db stuff by hand, but I'd like to learn the new stuff.
So at the bottom of the designer, I have a DataSet, 3 table adapters, 3 binding sources and only one binding navigator for the detail table.
Anyway, datagrid is connected to the detail table. All of the other controls on the form are connected to the master table via the same method except for the combo box which only contains the 3 records from the Site table.
Ok, so the form opens, you fill in the boxes, then go down to the data grid to fill in the 3 fields that are visible, then you're done (commit changes to master and detail recordsets) or you add another detail record (tied to the same master record). The problem is that there is a field in the datagrid that I don't have visible which is the MasterID that I use to tie these detail records to the correct record in the Master table.
The Actual Question:
So, how do I set/edit the MasterID field value of the current row (detail table) in the datagrid = the MasterID field value of the currently selected record of the Master table?
I realize I'm probably using the term 'table' incorrectly since I'm dealing with a dataset...old habbits...