populate data in a windows form combobox from a da
hello,
I am trying to populate a combobox data from database.
below is the code...
public void LoadCombo(string SQL, ComboBox cboGroups)
{
try
{
OleDbDataAdapter da = new OleDbDataAdapter(SQL,clsGeneral.GCONN);
DataSet ds=new DataSet();
da.Fill(ds,"dss");
cboGroups.DataSource=ds.Tables["dss"]; //.DefaultView;
cboGroups.ValueMember=ds.Tables["dss"].Columns[0].ColumnName;
cboGroups.DisplayMember=ds.Tables["dss"].Columns[1].ColumnName;
}
catch (Exception ex)
{
MessageBox.Show ("Error Coming For Country Combo" + ex.Message.ToString());
}
}
when ever i am trying to call this function i eceive an error message saying....
"No value given for one or more required parameters"...
can any one help me in resolving this...
i am realy stuck...
anirban
Anirban Biswas
|