Multiple forms one dataconnection and one dataset - Newbie

  • Thread starter Elizabeth Strachan
  • Start date
E

Elizabeth Strachan

To do this you need to declare the dataset as "public" on
the mdiform (c#) or alternatively use get/set to get to
it.
Then on the child form to get a reference to the dataset
do this:

DataTable dt = ((MainForm)this.MdiParent).MyDataTable;

MainForm should be replaced with the name of your parent
form and MyDataTable should be replaced with the name of
your datatable.

If you are a VB person then don't quote me but I think
public is Shared in vb and to cast you use CType or
something like that. I also think "this" is "me" in vb.

Clear as mud?

Sincerely,
Elizabeth Strachan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top