Expand|Select|Wrap|Line Numbers
- private void data(string dgvq, DataGridView dgvw, string sTableNm, DataSet dgset)
- {
- createconn();
- dgset.Clear();
- dAdapter = objADOUI.GetDataAdapter(dgvq, myConn);
- dAdapter.Fill(dgset);
- dgvw.DataSource = dgset.Tables[0].DefaultView;
- this.myConn.Close();
- }
I am calling this method on different buttons as the are clicked, by passing different parameters. shown below is an example of how its being called.
Expand|Select|Wrap|Line Numbers
- DataSet dset1 = objADOUI.GetDataSet();
- data(Qdgv, dgvDpnl, "TStudent", dset1);
But,when `button2` is clicked which has parameters as followed,
Expand|Select|Wrap|Line Numbers
- DataSet dset2 = objADOUI.GetDataSet();
- data(Qdgv, dgvDpnl, "TStudent", dset2);
`"At most one record can be returned by this subquery"` at `data(definition)>dAdapter.Fill(dgset);`
**Note:**
Let me tell u the problem is not with the query, since `button1` is also passing the query which has _sub-queries_ too.
I am aware that the problem is about `unloading` the resources in `datagridview`, `dataset` and `reloading` it.
But, I have tried a lot and couldn't find the solution.
Any help would be appreciated.