ArcadianSports
New Member
Hi,<BR><BR>This is the only way I have discovered to get the number of rows in a DataReader object, can anyone think of a better way?<BR><BR>If someone could also post code on how I can access the count property returned by a SQL statement, that would also help..<BR><BR>Dim numRowsInQuery as Integer = 0<BR><BR>Do While objDataReader.Read()<BR> stringResult += "<tr bgcolor = '#0589BC'><td>" & objDataReader("ID") & "</td><td> " _<BR> & objDataReader("CompanyName") & "</td><td> " _<BR> & objDataReader("ContactNumber") & "</td></tr>"<BR> <BR> numRowsInQuery += 1<BR>Loop<BR>You can see an example in this page:<BR>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnofftalk/html/Office12062001.asp