Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gridview record count

Status
Not open for further replies.

mzbutler

IS-IT--Management
Apr 9, 2010
2
GB
I have a simple gridview that is using sqldatasource, but I am trying to display the record count. I have read that by using you can display the record numbers, but this is not work the label is: Label1.Text = GridView1.Rows.Count.ToString. Please advise. I am using asp.net. I have also a search button and would also like to return the number of records return from the search button. Look forward to receiving a solution soon.
 
The problem is that you are using the sqldatasource control. I use a datatable or dataset and you can get the counts from these easily. I'm sure if you poke around and Google, you will find that somehow from the datasource controls you can get a count. This is just one small example of why I avoid using them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top