Only want to return the first 3 results!

Marshall700

Member
Joined
Apr 21, 2011
Messages
19
Programming Experience
Beginner
Im using a gridview and i only want to show the first 3 results! No idea where to even begin here???

Any suggestions?

Thanks
 
If you're saying that you only want to retrieve three records from the database then something like this would work in SQL Server and I think that it's valid in Access too:
VB.NET:
SELECT TOP 3 * FROM MyTable
 
Yeah i think that wud do me. Is there a way of possibly counting how many rows are returned if. There is less than 3 by possibly using count() and group by???

Thanks
 
If you're using a DataAdapter to populate a DataTable then Fill will return the number of records retrieved by the query. If you're using an ASP.NET data source control then I don't know as I've never used them.
 
Back
Top