hi all,
I have the main form which has a combobox of all locations. If the location is available it is slected by user if not the user clicks a button next to and another form pops up where user can add,update, delete locations. Obvioiusly when the user adds, delete, updates the locations it should be updated in the main form too.
I do it as follow:
frmCDs frmParent=new frmCDs();
frmParent.FillLocationCombo();
It goes to the sub but doesn't update the combobox i don't know why?
The code in the sub is as:
string sqlstr="select * from tblLocation";
DataSet ds2=new DataSet();
ds2=data.ReturnAll(sqlstr);
cboLocation.DataSource=ds2.Tables[0].DefaultView;
cboLocation.ValueMember="LocationID";
cboLocation.DisplayMember="Location";
regards
I have the main form which has a combobox of all locations. If the location is available it is slected by user if not the user clicks a button next to and another form pops up where user can add,update, delete locations. Obvioiusly when the user adds, delete, updates the locations it should be updated in the main form too.
I do it as follow:
frmCDs frmParent=new frmCDs();
frmParent.FillLocationCombo();
It goes to the sub but doesn't update the combobox i don't know why?
The code in the sub is as:
string sqlstr="select * from tblLocation";
DataSet ds2=new DataSet();
ds2=data.ReturnAll(sqlstr);
cboLocation.DataSource=ds2.Tables[0].DefaultView;
cboLocation.ValueMember="LocationID";
cboLocation.DisplayMember="Location";
regards