How to check whether SqlDataReader contains any rows or not?

 Posted by vishalneeraj-24503 on 12/17/2013 | Category: ADO.NET Interview questions | Views: 2120 | Points: 40
Answer:

SqlDataReader has HASROW property,which returns true,if it contains any row otherwise returns false.

For Example:-
if(dr.HasRows)

{
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response