Dataset,reference, parameters?

M

Matej Kavèiè

Hello,
Iam newbie, I want to ask some basic question. I come from Delphi world. In
Delphi I have DataModule where i put down all coonnection, datasets and
so...Is it posible and how can i do that in C#, I create new form and put on
sql Connection, datadapters and create datasets, so how can i now use this
datasets in other forms, i cannot find any examples on internet. also i
donn't know how to call some function in other forms, in delphi i call like
form2.DoSomething; how to do this in c#, please could somebody write few
line of code how to do this.

thanks
 
M

Miha Markic

Hi Matej,

You can't share them within designer.
You'll have to pass references to another form.
 
J

Jay B. Harlow [MVP - Outlook]

Matej,
Normally what I do is to add a new Component (Project Add Component) to my
project, the put all the connection, adapters, commands and so on this new
component. I then add methods to the component to "simplify" the interface,
for example I may have a single Fill method that invokes Fill on all the
contained adapters...

Then from my Forms I can reference this component & use the part I need.

Note if you add the component to your form, each form will get a new
instance, its may be "better" to implement the Component as a singleton and
manually invoke the methods.

Using a Component gives you a visual designer without the overhead of an
actual form.

Hope this helps
Jay
 

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