|
-
Sep 21st, 2004, 07:27 AM
#1
Thread Starter
PowerPoster
datagrid?
How do i view the results of a table in a datagrid or dataresult? What do i do?
-
Sep 21st, 2004, 09:18 AM
#2
Frenzied Member
You mean binding the data to your DataGrid? Windows Forms or web app? I've got some example in both if it will help.
-
Sep 21st, 2004, 09:25 AM
#3
Thread Starter
PowerPoster
databind i think think i got it done but would like your example for a windows app
-
Sep 21st, 2004, 09:31 AM
#4
Frenzied Member
Code:
private void RefreshData(string tableName)
{
dsThisTable = DataBase.GetTable(tableName);
dgSelectedTable.CaptionText = tableName;
dgSelectedTable.SetDataBinding(dsThisTable, tableName);
}
dsThisTable is a DataSet. dgSelectedTable is my DataGrid. DataBase.GetTable returns a DataSet (yeah, probably didn't name things quite right).
This is part of a generic form that gets all the user tables and views from a SQL Server DB, and populates a TreeView with their names. Then, when you click on a table/view, the DataGrid gets bound to that table/view. Quick little way to view/update any DB I point it to.
Mike
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|