Solved

record count in vb.net

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WPF - Tooltips for ComboBox items 5 70
How useful is the free version of Selenium? 3 34
Footer for each row on Gridview 2 21
DataTables + iCheck + pagination Issue 2 17
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

776 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