|
-
Mar 31st, 2004, 11:14 AM
#1
Thread Starter
Frenzied Member
recordset.recordcount not working as expected [RESOLVED]
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
Last edited by Andy; Mar 31st, 2004 at 12:41 PM.
-
Mar 31st, 2004, 11:22 AM
#2
Frenzied Member
That may be because this is vb.net, where there is no recordset.
You could use myDataSet.Tables("myTable").Rows.Count in vb.net
-
Mar 31st, 2004, 11:31 AM
#3
Thread Starter
Frenzied Member
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
I'm using ado. (obviousely) and there IS a recordset. I have the cursor type set right (i thought that may be a problem).
It makes no sense. I'll try out what you suggested and see if that works.
-
Mar 31st, 2004, 12:08 PM
#4
Thread Starter
Frenzied Member
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.
-
Mar 31st, 2004, 12:20 PM
#5
Frenzied Member
Don't know, show some code. Why would you use ADO in .net? You might as well use vb6 in that case.
-
Mar 31st, 2004, 12:41 PM
#6
Thread Starter
Frenzied Member
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().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|