Home
C# Check If DataTable Contains Data
Blog Date 9 June 2021
The Error
there is no row at position 0
The Code
if(MyDataTable.Rows.Count > 0)
{
//do something with the data
}
else
{
//there is no data
}
The Explanation
Errr... just check to see if there are any actual rows by counting them.
Full stack web development - contact ren@techsolus.co.uk
Reader's Comments
Name
Comment
Add a RELEVANT link (not required)
Upload an image (not required)
Uploading...
Home