Bug reports Found a bug? Post it here please.
Version 4.x > Bug reports > regarding dataset tables count View modes: 
User avatar
Member
Member
ASI-fujibikes - 9/12/2009 2:32:21 PM
   
regarding dataset tables count
In my custom code I have used checks at many places, like checking for dataset tables count..

example:
Dataset ds = ...

if (ds.Tables.Count > 0)
{
.....
}

After I upgraded to 4.1.3 ..I am getting error like object reference not instantiated...I am naive with this CMS and cant understand is there any changes related to dataset has been done in the code base....

If you have any work around suggestions please let me know..

Thanks a lot in advance.

Sid


User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 9/16/2009 4:09:22 AM
   
RE:regarding dataset tables count
Hi,

Could you please let us know what exactly are you trying to achieve?
If you want to check if dataset is empty/not empty, you can use following API code:

CMS.GlobalHelper.DataHelper.DataSourceIsEmpty(ds)

Best Regards,
Miroslav Remias.