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
j1mb0jay - 12 Jan 2008 00:49 GMT
> I am pretty new to C# and .NET and am using VS 2005.
>
[quoted text clipped - 10 lines]
>
> Kevin
Could you write a SQL Class that is static, which contains static
methods to execute queries and non queries. ???
j1mb0jay
Peter Bromberg [C# MVP] - 12 Jan 2008 02:21 GMT
It really depends whether you are going to get your DataSet one time and have
it appy to the entire application instance. If you put this in a static class
with a static DataSet that is public, the object would be visible from any
child window with
MyStaticClass.MyDataSet
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
> I am pretty new to C# and .NET and am using VS 2005.
>
[quoted text clipped - 10 lines]
>
> Kevin