I'm trying to find the total number of records in a recordset by using rs.recordcount. It always returns -1 and I know (by using data I created JUST for this) that there should be 2 records:confused:
Printable View
I'm trying to find the total number of records in a recordset by using rs.recordcount. It always returns -1 and I know (by using data I created JUST for this) that there should be 2 records:confused:
That may be because this is vb.net, where there is no recordset.
You could use myDataSet.Tables("myTable").Rows.Count in vb.net
I'm using ado. (obviousely) and there IS a recordset. I have the cursor type set right (i thought that may be a problem).Quote:
Originally posted by salvelinus
That may be because this is vb.net, where there is no recordset.
You could use myDataSet.Tables("myTable").Rows.Count in vb.net
It makes no sense. I'll try out what you suggested and see if that works. :)
ok. found out that it's not working 'cause the database is not setup to allow it.
how can I use the count() function? I can't figure out how to read the return value from the function.:confused:
Don't know, show some code. Why would you use ADO in .net? You might as well use vb6 in that case.
well, I have argued with my project leader for months about ado vs ado.net He has more seniority lol
I figured this out:
You have to have two SELECT statements and use an if statement to check the value of the count().