Wrox Programmer Forums
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2005, 11:03 PM
Authorized User
 
Join Date: Feb 2005
Posts: 91
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ashokparchuri Send a message via Yahoo to ashokparchuri
Default count of rows

hi,

  i am getting data from database upto that it is ok for me.i want to count the number of rows.if there are no rows present in the database i want to display some message in label... hoew to do that.

    note: please don't say we can do that by select count(*) method. please tell me any other method.with out using sql commands.


                                thanks in advance-Ashok Parchuri
 
Old April 18th, 2005, 11:18 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 224
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to ashu_from_india Send a message via Yahoo to ashu_from_india
Default

hi

if u dont want to use SQL command then, u can use a DataTable object.
u can get no. of rows by DataTable.Rows.Count


Ashu

 
Old April 19th, 2005, 01:12 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Check out this FAQ: http://Imar.Spaanjaars.Com/QuickDocId.aspx?QUICKDOC=356


Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old April 19th, 2005, 11:19 AM
Registered User
 
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to cbrknight1
Default

RS = clsSqlHelper.ExecuteDataset(clsSqlHelper.DBConnStr ing, CommandType.Text, strSQLQuery)

            If RS.Tables(0).Rows.Count > 0 Then
                Debug.WriteLine(RS.Tables(0).Rows.Count.ToString)
                Return RS
            Else
                 ......

i THINK IT WILL HELP

--Alex Z.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Display count of rows debjanib ASP.NET 1.0 and 1.1 Professional 7 May 5th, 2006 04:13 AM
retrieve everything AND count rows in one hit crmpicco MySQL 5 January 20th, 2006 06:02 AM
count the number of rows in the table crmpicco Javascript How-To 4 February 2nd, 2005 12:58 AM
count child table rows melvik C# 6 January 25th, 2004 01:39 AM
count or show child table's rows melvik ADO.NET 0 January 22nd, 2004 11:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.