Database : select query


#1

Hi, If we hit a select query in database and need to verify whether query has fetched any rows or not. Please suggest how can we verify it.


#2

execute query returns a datatable, so you could use table.rows.count to get the number of rows.


#3

use

if(DataTable.Rows.Count>0)
{
Task which you want to perform
}


#4

Thanks a lot for response. It is working fine.