(system) Variable that holds the record count of a result set?

msimon7

Member
Joined
Jan 13, 2006
Messages
9
Programming Experience
10+
Hello
is there a variable that is available to me that contains the number
of rows contained in a dataset return from a database call?
have a class that runs a stored proc and returns a dataset/resultset
looking to simply assign an integer this value if it is possible
i'm using (learning) vb.net and sql server
thanks any help!
 
hi, there is definately one way which would be to simply use the count function to count the number of rows in your datatable (not dataset). OR...

At the risk of making myself look like an idiot, you may be able to assign a integer value when calling fill on the dataadapter.....

Dim i as integer = datatadapter.fill(tablename)
 
Well thats kind of what i just said. However you coding could be misleading to someone who is new to VB.Net. Your code assumes that there is only one table in the dataset, what if there is more, or your code assumes that if there is more than one table then the datatable that msimon7 wants is at the zero index, how do you know?
 
Back
Top