DataAdapter Scope

K

Kevin

I am pretty new to C# and .NET and am using VS 2005.

Let's assume I have an MDI application with various child windows, each of
which will need access to a database. My question is: where would be the best
place to instantiate the DataAdapter and DataSet objects so I would only have
to do so once in the application and make them available to all of the child
windows?

Would I define them as public somewhere in the MDI parent? I'm just not sure
what the best approach would be.

Thanks in advance for your help!!

Kevin
 
J

j1mb0jay

Kevin said:
I am pretty new to C# and .NET and am using VS 2005.

Let's assume I have an MDI application with various child windows, each of
which will need access to a database. My question is: where would be the best
place to instantiate the DataAdapter and DataSet objects so I would only have
to do so once in the application and make them available to all of the child
windows?

Would I define them as public somewhere in the MDI parent? I'm just not sure
what the best approach would be.

Thanks in advance for your help!!

Kevin

Could you write a SQL Class that is static, which contains static
methods to execute queries and non queries. ???

j1mb0jay
 

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