Hello everybody,
I need help on how to use the same datase in two different form, this is the
scenario:
at the first form I load a big dataset (ds1) for short, but I not want to
load it again at the second form
at some point I use a second form
Form f = new FormX();
f.ShowDialog();
at the f form I need to use ds1, and I have the same ds1 in the f form
I tried assigning public access for f.ds1
and do like this:
Form f = new FormX();
f.ds1 = this.ds1;
f.ShowDialog();
also I tried passing it at the constructor like this:
Form f = new FormX(ds1);
f.ShowDialog();
all the time the dataset ds1 at the second form have no rows
the only way I get the record is using the merge method this way
Form f = new FormX();
f.ds1.Merge(this.ds1);
f.ShowDialog();
but it take the time for filling the dataset f.ds1 again
the solution that I need is to use the same dataset or at least not take the
time for load it again
Thanks for your help
MajorTom
Maqsood Ahmed - 16 Jan 2005 06:41 GMT
Hello!
I believe you might want a class which can contain the dataset in it and
then form1 and form2 both use the same dataset using its property. Also
try to use DataSet.Copy method while getting the DataSet from the class.
Cheers :)
Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
MajorTom - 17 Jan 2005 01:33 GMT
Thanks, I will try thath way
MajorTom
> Hello!
> I believe you might want a class which can contain the dataset in it and
[quoted text clipped - 8 lines]
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!