Friday, May 16, 2025

Breaking News
>> Securing and encrypt View State and Cookies values  >> Page has one or more controls that do not correspond with   >> “The Controls collection cannot be modified because the control contains code blocks”  >> How to fix "Validation(): Element 'xxxx' is not supported  >> How to create a new session in ASP.NET programmatically  >> MySQL Database Backup using mysqldump command    

Editors Picks

Thursday, June 16, 2011

how to check for NULL in DataTable


how to check datatable is empty


In think, you are using  dtUserSettingvalues before initialization and dtUserSettingvalues does not have any reference to DataTabe object so that is why you are getting this error, if there is such case in your code then you can do this check in this way



if ((dtUserSettingvalues != null) && (dtUserSettingvalues.Rows.Count != 0))
    {
    //do your code

    }

No comments :

Post a Comment

Contact Us

Name

Email *

Message *