-----Original Message-----
This is the example you see in the Microsoft .NET help file:
private void SetSourceAndMember(){
DataSet myDataSet = new DataSet("myDataSet");
DataTable tableCustomers = new DataTable("Customers");
myDataSet.Tables.Add(tableCustomers);
// Insert code to populate the DataSet.
// Set DataSource and DataMember with SetDataBinding method.
string member;
// The name of a DataTable is Customers.
member = "Customers";
dataGrid1.SetDataBinding(myDataSet, member);
}
The SetDataBinding is a runtime method, which is useful if you are dealing
with the possibility of reuse (ie, you can set multiple tables to the
DataGrid, depending on your needs). You can also bind the specific table,
like so:
dataGrid1.DataSource = myDataSet.Tables[0].DefaultView;
dataGrid1.DataBind();
The tables collection can also be accessed by name.
--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
********************************************************* *************
Think Outside the Box!
********************************************************* *************
Michael said:
Hi guys,
I'm new in developing applicationa in C# and I have a
very strange effect to display my data in the DataGrid:
the method SetDataBinding is unknown for my DataGrid
I use the following codesample:
myDataGrid.SetDataBinding(myDataSet, "Customers");
please can you help me?
Thanks...
.