Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > numbering rows in datagrid

Reply
Thread Tools

numbering rows in datagrid

 
 
buran
Guest
Posts: n/a
 
      10-15-2003
Dear ASP.NET Users,

How can I get the total number of rows selected by the command text of the
datagrid (items in datagrid)? If I use the statement grdSP.Items.Count with
the datagrid grdSP with paging, it returns the page size (5,10..) not the
total results. How can I get the total no?
Thanks in advance,

Buran


 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      10-15-2003
Depends. If you are using a DataSet to bind, you can do the following:

int rowCount = DataSet1.Tables[0].Rows.Count;

or VB.NET

Dim rowCount as Integer = DataSet1.Tables(0).Rows.Count

If you are using a DataReader, you have to stream through the entire reader
to get the end result. For paging and sorting, DataReaders are not the best
option overall.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************** ********************
Think Outside the Box!
************************************************** ********************
"buran" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Dear ASP.NET Users,
>
> How can I get the total number of rows selected by the command text of the
> datagrid (items in datagrid)? If I use the statement grdSP.Items.Count

with
> the datagrid grdSP with paging, it returns the page size (5,10..) not the
> total results. How can I get the total no?
> Thanks in advance,
>
> Buran
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
hide/delete rows & the consequent page numbering problem Thomas Kopp ASP .Net Datagrid Control 0 03-01-2007 07:59 PM
numbering rows in datagrid buran ASP .Net 1 10-15-2003 01:54 PM
numbering rows in datagrid buran ASP .Net Web Controls 2 07-07-2003 12:48 PM
numbering rows in datagrid buran ASP .Net Datagrid Control 2 07-07-2003 12:48 PM
numbering rows in datagrid buran ASP .Net 2 07-07-2003 12:48 PM



Advertisments