Question : How to find the row count in an Oracle DataReader in ASP.NET?

Hi Experts,

I have to find out how many rows are existing in a Data Reader, I am using Oracle Data Reader and the ASP Version is 1.1. The requirement is I am using a datagrid in side the web form for viewing the site details (Supplier Site) There may be multiple site under one operating unit. When the user clicks the link button view site details in the first row ie e,item.itemindex = 1 then I have to use the 1 row of the data reader, and if the user clicks the second row, then I have to use the details in the second row of the Data Reader.

How can I achieve this? Please help me. Please do get back to me, if you have any further questions regarding this issue.

Thanks
Dileep

1:
2:
3:
4:
5:
6:
7:
8:
objDataReader = objSupplier.GetAllSupplierSitesDR(Request.QueryString["sid"].ToString(),Request.QueryString["oid"].ToString(), Request.QueryString["rid"].ToString(),userid,CurStatusID);
			objDataReader.c
			if (objDataReader.Read())
			{
				strEntityNamer = objDataReader["O_ENTITY_R"].ToString();
				strSiteNamer = objDataReader["O_VSName_R"].ToString();
				strCountryr = objDataReader["O_VSCOUNTRY_R"].ToString();
			}

Answer : How to find the row count in an Oracle DataReader in ASP.NET?

You can go directly to it, thanks to the indexer
If you want to retrieve the 5th row, you need to get the indexer of 4 (because 0 is the first record)

if (dt.Rows.Count > 5)
{
   // get the value of the first column
   String x = dt.Rows[4][0].ToString();
}
Random Solutions  
 
programming4us programming4us