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 filter the data in the DataView and display it in some DataControl
VB.NET Dim thefilter as string = ‘fieldname=’’ ‘ dbDataView.RowFilter = thefilter Repeater1.DataSource = dbDataView Repeater.DataBind() C# string thefilter = ‘fieldname=’’ ‘; dbDataView.RowFilter = thefilter; Repeater1.DataSource = dbDataView; Repeater.DataBind();
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
How to get the count of records in the Database table using the DataSet
VB.NET ds.Tables(0).Rows.Count C# ds.Tables[0].Rows.Count ;
What is the Performance comparison between DataSet and DataReader
Refer Performance Comparison: Data Access Techniques