Is there any way to manage a dataset inside of a child form?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
manuel.romero
Posts: 13
Joined: Wed 07 May 2008 09:08

Is there any way to manage a dataset inside of a child form?

Post by manuel.romero » Mon 16 Jun 2008 08:14

Hello everybody!

I have a little question, maybe for you is trivial but I couldn't discover how to make update, fill or clear of a dataset from a form which is child of the form which has the dataset.

I have tried to put the dataset as static, in that it works but when I exit from the project and enter again I have lots of warnings from all the datalinks complaining because they can't find the dataset.

Any another solution?

Thanks a lots for your help. Regards,

Manuel J. Romero

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Tue 17 Jun 2008 10:13

Hello Manuel,

Try setting the Modifiers property of the DataSet instance on the form (e.g. DataSet1)
to public. This should solve the problem.

Regards,
Alexey.

manuel.romero
Posts: 13
Joined: Wed 07 May 2008 09:08

Post by manuel.romero » Tue 17 Jun 2008 10:38

Hi!

Let's see how can I access to a parent variable from the child if I don't have the reference of the parent? For example I have:

A parent form named parentForm with a public dataset named dataset1, if I call that form from another form I should make:

parentForm pF = new parentForm();

and now I could make pF.dataset1.Fill();

But from a child I don't have pF because this is the called form. At the moment I could access putting the dataset like static and from the child:

parentForm.dataset1.Fill()


What am I making wrong?


Thanks a lots for your help.

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Wed 18 Jun 2008 08:27

Hello,

I have sent you a sample project.
Please let me know if I should resend it.

Regards,
Alexey.

manuel.romero
Posts: 13
Joined: Wed 07 May 2008 09:08

Post by manuel.romero » Wed 18 Jun 2008 10:06

Thanks a lots for your example!

But in my case, my project is different because I'm using a form with the dataset and UserControls which I added to the form to create pages. So when I said child forms I wanted to say the child pages. And I can't inherit from the form because they are different classes.

At the moment I'm sending the dataset in the constructor of the pages, and when I make a clear or a fill operation it worksright because the objects, which use the "parent" dataset, update their contents at the same time when I refill the dataset in the child page.

Is this a good solution?

Thanks a lots for your help.

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Wed 18 Jun 2008 15:55

Hello,

Is it a WinForms application or an ASP.NET one?
Could you please make a small test project and send it to me (alexeyman*devart*com)?

Regards,
Alexey.

manuel.romero
Posts: 13
Joined: Wed 07 May 2008 09:08

Post by manuel.romero » Thu 19 Jun 2008 10:30

Hi!

I have sent a test project to your email. And it's a winform application.

Regards,

Manuel Romero

Alexey.mdr
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Thu 19 Jun 2008 10:47

Hello Manuel,

Thank you for the inquiry.
I have received the project.
I will contact you in the nearest time.

Regards,
Alexey.

Post Reply