Click to See Complete Forum and Search --> : passing dataset between forms


jsiegendorf
February 3rd, 2005, 01:33 PM
I have an application that uses MDI. In my parent form I have a typed dataset and fill it with a data adapter. Then I create a child form and pass a reference to the dataset when I show the form:

In the parent form:

private MyProgram.tds dsParent;

...

MyChild frmChild = new MyChild(ref dsParent);
frmEPM.MdiParent = this;

frmEPM.Show();


In the child form I want to create another dataset that is a reference to the parent dataset, so that anything done to the dataset in the child form is effectively working on dsParent. Here is the code in the child form:


private MyProgram.tds dsChild = new MyProgram.tds();;

...

public MyChild(ref tds ds)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

dsChild = ds;
dg.SetDataBinding(dsChild, "MyTable");
}


When I make changes to MyTable in the child form, the dataset dsParent is not changed. What am I missing??? Thanks in advance

Jason