Solved

record count in vb.net

Posted on 2004-03-30
4
815 Views
Last Modified: 2008-03-03
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
Comment
Question by:mahalakshmi_s
  • 2
4 Comments
 
LVL 48

Accepted Solution

by:
Mikal613 earned 50 total points
ID: 10714715
0
 

Expert Comment

by:leavitt76
ID: 10714867
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
 

Expert Comment

by:leavitt76
ID: 10714886
Oops, I meant to say ".RecordCount" not ".Count" for the data adapters property.
0
 

Author Comment

by:mahalakshmi_s
ID: 10715108
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now