How do I bind two DataGrids in a master-detail relationship?

Please download this sample before reading the rest of this FAQ. Looking through the sample will help follow the description. Simpledata2.

Zip What this boils down to is this: 1) Load both Master and Details queries in a dataset. // I am using the SQL server NorthWind database this. DataAdapterMaster.

Fill(this. DataSet, "Customers"); this. DataAdapterDetails.

Fill(this. DataSet, "Orders"); 2) Bind the master data grid to the Master dataset table. // The master view grid.

DataSource = this. DataSet; grid. DataMember = "Customers"; 3) Create a relationship that describes how the two tables relate to each other.

A primary key foriegn key relationship is defined by two attributes. The primary key column in the master table The foreign key coumn in the details table The created relationship is added to the dataset.this.dataSet.Relations. Add("CustomersToOrders", dataSet.

Tables"Customers". Columns"CustomerID", dataSet. Tables"Orders".

Columns"CustomerID"); 4) Set the data member for the details ... more.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions