how do i check if dataset is null ?
how do i check if dataset is null ?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jithil JohnPosted Mar 6, 2015, 3:20 AM
sumit kumarPosted Mar 6, 2015, 3:11 AM
suppose you have a DataSet object as ds already which is filled from tables from database or in you filled it manually
if(ds != null && ds.Tables.cout > 0 && ds.Tables[0].Rows.Count > 0)
{
//write your code to access ds data here
}
Jithil JohnPosted Mar 6, 2015, 1:42 AM
check whether ds.Tables[0].Rows.Count == 0 or not.
Prasham SabadraPosted Mar 6, 2015, 12:42 AM
Please check following links
http://www.aspdotnet-suresh.com/2012/07/how-to-check-dataset-is-null-or-empty.html
http://stackoverflow.com/questions/2976473/how-to-test-if-a-dataset-is-empty
Please let me know if more details are required.