How do i check if dataset is null ?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Prasham SabadraRank #116 · 19.3K reputationPosted Mar 5, 2015, 7:42 PM EST
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.
sumit kumar131 reputationPosted Mar 5, 2015, 10:11 PM EST
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 JohnRank #2,791 · 506 reputationPosted Mar 5, 2015, 8:42 PM EST
check whether ds.Tables[0].Rows.Count == 0 or not.
Jithil JohnRank #2,791 · 506 reputationPosted Mar 5, 2015, 10:20 PM EST