So what does this exactly means?
Some advised that to circumvent around this error, only bind a gridview to a dataset when the rows count of the datatable is greater than zero.
but how about if for example your search yielded no record returned, so your datatable would have no rows, but still, you can still bind to the dataset?
Aside from checking if rows are in the dataset (or datatable), how would I ensure that the ilist contains valid datasource?
what's the best method for this?
Make sure you use this:
if (!this.IsPostBack)
{
}
Also you can check the dataSet.Tables.Count > 0 then return dataSet else return null;
I think the DataSet return have Count = 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With