How do i view the results of a table in a datagrid or dataresult? What do i do? :)
Printable View
How do i view the results of a table in a datagrid or dataresult? What do i do? :)
You mean binding the data to your DataGrid? Windows Forms or web app? I've got some example in both if it will help.
databind i think :) think i got it done but would like your example for a windows app :)
dsThisTable is a DataSet. dgSelectedTable is my DataGrid. DataBase.GetTable returns a DataSet (yeah, probably didn't name things quite right).Code:private void RefreshData(string tableName)
{
dsThisTable = DataBase.GetTable(tableName);
dgSelectedTable.CaptionText = tableName;
dgSelectedTable.SetDataBinding(dsThisTable, tableName);
}
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