I have two datasets. One dataset table from dataset1 is bound to a list box. On selection in the list box dataset2 has 9 tables that are populated from the database. these tables are then data-bound to 9 combo boxes. Following selection of items in the combo boxes and the click of a button, the results are then manually written back to the first table in dataset1. The problem that I am having is that after the selection in the first combo box is written to the table, all of the combo boxes revert to their previous selection. Following are the sections of code which I think should be needed:
//create the tables in the second dataset
cbLineupPosition[i-1].DisplayMember = "PositionName";
cbLineupPosition[i-1].ValueMember = "PositionID";
cbLineupPosition[i-1].DataSource =DataSet2.Tables["LineupPosition"+i.ToString()];
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["One"]
=cbLineupName[0].SelectedValue;
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["Two"] =
cbLineupName[1].SelectedValue;
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["Three"] =
cbLineupName[2].SelectedValue;
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["Four"] =
cbLineupName[3].SelectedValue;
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["Five"] =
cbLineupName[4].SelectedValue;
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["Six"] =
cbLineupName[5].SelectedValue;
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["Seven"] =
cbLineupName[6].SelectedValue;
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["Eight"] =
cbLineupName[7].SelectedValue;
DataSet.Tables["teams"].Rows[lbTeams.SelectedIndex]["Nine"] =
cbLineupName[8].SelectedValue;