jjanos_

jjanos_

  • NA
  • 2
  • 0

Dataset lost if constructor called

Jan 21 2005 9:11 PM
First sorry for my bad english. This is the problem that I have. I have two forms and a classlibrary. Classlibrary is called broker, mainform is the mainform and modform is the second form. I use broker for the conection with the dataset and the base and in the constructor of the broker, I initialize the dataset. In the constructor of the main form I create instance of the broker class so I could access the data in the dataset. The problem is next: I need to call a method in mainform when an event occurs in the modform (combobox onchange) from the modform. For that to work I need to create an instance of the mainform in modform. If I do that I recreate the dataset because of constructors in broker and mainform and lose the data from dataset. If I move the dataset init from the broker constructor or broker init from the mainform constructor the program does't see the data. Is there any way to call a method from another form without creating an instance or some other method for creating a dataset. I know that this isn't completely data related (more c# programing) but I thought that some of you had a simmilar problem. Thanx for any help