Link to home
Start Free TrialLog in
Avatar of mahalakshmi_s
mahalakshmi_s

asked on

record count in vb.net

Hi,
what is the equivalent of rs.recordcount of VB6.0 in VB.NET ?
Dim connstr = "server=s07\mumford;uid=gdbuser;pwd=gdbuser;database=NySample"
        Dim sqlConn3 As New SqlConnection(connstr)
        sqlConn3.Open()
        Dim rsNickNames_sqlcomm As New SqlCommand("SELECT * from tabNickName", sqlConn3)

Can we use like this or is it wise to use ADO ? Pls help,
Maha
ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of leavitt76
leavitt76

You would be much better off with ADO.NET as it is managed code and highly integrated with the rest of the .Net languages.

ADO.Net has many changes from ADO.  There is a good tutorial here:

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1169&lngWId=10

As far as the count, you can get this from the .count property of your data adapter object once you get that far in your code.  BTW: use a data adapter if you need a count, not a data reader which is forward only and does not support counts/updates.

Good luck.

Oops, I meant to say ".RecordCount" not ".Count" for the data adapters property.
Avatar of mahalakshmi_s

ASKER

leavitt76,
I actaully needed for RecordCount only. But ur info abt ADO.NET was very useful though pictures are not available in that downloaded material :-(
Thanks
Maha