Solved

how do i get "rows count" by using OdbcDataReader

Posted on 2006-06-09
3
1,058 Views
Last Modified: 2008-02-01
the following is my code for execute query.. i wonder how do i get the total of rows count

Dim cmd As New OdbcCommand(Str, MyConn)
    Dim cmdreader As OdbcDataReader

    Dim Str = "SELECT name FROM user"
    cmd.CommandText = Str

        Try

            MyConn.Open()
            cmdreader = cmd.ExecuteReader()

            if cmdreader.HasRows Then
               //////     rows count    //////////////
            end if

        End Try  
0
Comment
Question by:kengkit
3 Comments
 
LVL 27

Accepted Solution

by:
Sammy earned 50 total points
ID: 16875272
There is no way you can do that with datareader out of the box, but there is a work around and you can see it here
http://www.devx.com/vb2themax/Tip/18807
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
Why is "packages element is not declared"? 2 128
Data is not showing from images 15 37
Error on Add method 1 37
Server Error 11 47
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
Send secure, cloud-based, encrypted alerts and maintain HIPAA compliant messaging. Integrates priority & secure messaging into one application. Ensures IT, emergency respondents and healthcare professionals that their critical messages are never mis…

911 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

22 Experts available now in Live!

Get 1:1 Help Now