Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

DataAdapter Scope

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kevin - 12 Jan 2008 00:41 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.