views:

196

answers:

5

Hi,

I have a database table (sql server 2008) that I want to view data for, what is the quickest way of displaying this data?

(if it could have paging that would be perfect).

Would it be a gridview or ?

query: select * from testData

+3  A: 

Hello, if you're using .NET 3.5 you could use ASP.NET Dynamic Data:

http://www.asp.net/dynamicdata/

Hope this helps!

Adam Alexander
+2  A: 

via ADO.NET get your data into a DataSet or DataTable.

then:

gridview.DataSource = yourDataTable;
gridview.DataBind();
Kon
A: 

Use LinqToSql and bind the results to a grid view.

NotDan
A: 

Gridview would be a perfect solution

you can have paging and sorting with that just by the properties AllowPaging="true" PageSize="##" AllowSorting="true" and if you want all the data and not just specific rows you can just do AutoGenerateColumns="true"

jmein
can I embed the sql w/o doing codebhind?
@Blankman if you use an objectdatasource to hold the query
jmein
+1  A: 

if its a web app, gridview control and use cache objects to hold data set... every time connecting to db is time consuming...

pros: performance cons: can't handle large tables unless you have server memory to handle it.