what i'm not clear about is how to save selected items in the UI back to the database. I am using table adapters to fill datasets and i need to preserve any selections in the db. I am trying to figure out how to do this whenever a selection is made. The combo boxes generally are loaded from lookup tables and i set the value in the combo boxes when a tab panel is painted by reading the value from the source table from a label on the tab control panel.
if i can get the form to update the table to a new value, on re-paint i would expect to see the new value. but i am really confused as to how this is supposed to happen.
i understand one scenario is, a dataset is being modified and there's a method to update the entire dataset to the source table. there's another option to update a specific row (but you'd need to locate the row first). Or you could just go with commands and do SQL directly to the source table. I think I'd like to not do that, but i will if i have to.
To be specific, here's a dataset for a look-up use to bind to a combo box:
Me.LU_B4TableAdapter.Fill(Me._MyDatabase_1DataSet.LU_B4)
This is bound to the combo box using the Properties DataSource options.
In addition, there's a label on the form that is bound to the 'main' table i want to update:
Me.EditMDSTableAdapter.Fill(Me._MyDatabase_1DataSet.EditMDS, DLN:=DLN)
Label B4 is bound to this data source to the specific column and value based on a passed parameter. the Combo box is set to display the value from the label:
Me.ddUE_B4.SelectedValue = Me.B4.Text
Now, if i make a selection in the combo box am i not modifying the dataset of the combo box? If so, how do i send that change to the dataset EditMDS? This is where i am stuck.
I could just chuck all the dataset business and use SQL commands. That seems a bit odd as i am foregoing any advantages to datasets and table adapters, but it's something i can do. So, I dunno.