Breaking News

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

    }
Read more ...

Contact Us

Name

Email *

Message *