[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 827
  • Last Modified:

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
0
mahalakshmi_s
Asked:
mahalakshmi_s
  • 2
1 Solution
 
leavitt76Commented:
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.

0
 
leavitt76Commented:
Oops, I meant to say ".RecordCount" not ".Count" for the data adapters property.
0
 
mahalakshmi_sAuthor Commented:
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
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now