Solved

record count in vb.net

Posted on 2004-03-30
4
816 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with deleting records with two duplicate columns using VB.NET 12 43
Get id from json Data with NewtonSoft 3 34
Error on link 14 37
Variable Event ? 3 22
It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

910 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

18 Experts available now in Live!

Get 1:1 Help Now