Which property of SqlDataReader object is used for getting no of columns in row?

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

SqlDataReader'FieldCount property is used for getting no of columns in current row.
It returns no of columns as integer value means it counts columns.

int no_of_columns = dr.FieldCount;

where dr is our SqlDataReader object.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response