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!

DataGridView/BindingSource Count Limit

Status
Not open for further replies.

SgtJarrow

Programmer
Apr 12, 2002
2,937
US
I have a DataGridView bound directly to a SQL table via a BindingSource object. The BindingSource is sorted DESC for a couple fields.

Without creating a view or anything, is there a way to display only top X items?

This is a version history page of a project. I did not want to create a view or SQL to pull the data, but the table now has about 200 records in it and I want to display the last 20 or so...

If not, I'll make a view to pull the top 20.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Robert, I dont think this is possible with a bound dgv. Even if it were, it would be more efficient to do a "select top 20" query and then bind to datagrid.

Cheers

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top