How to find the null fields in the datareader

VB.NET If dbReader(‘fieldname’).Tostring= DBnull.Value.ToString() ’Empty field value Else ’Display value End if C# if (dbReader[‘fieldname’).ToString() == DBNull.Value.ToString() ) { //Empty field value } else { //display Value }

How to retrieve value of a field in a dataset

VB.NET ds.Tables(‘TableName’).Rows(0)(‘ColumnName’) C# ds.Tables[‘TableName’].Rows[0][‘ColumnName’]; where TableName and ColumnName could be also integer (not in quotes then) to indicate you refer to the table’s or column’s index position. Rows(0) indicates the first and only row in DataTable’s Rows collection