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 / .NET Framework / ADO.NET / January 2006

Tip: Looking for answers? Try searching our database.

DBAccess in WinForms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vedanshu Mandvikar - 26 Jan 2006 21:30 GMT
Hi EveryOne,

What is the best approach for data access while developing applications
using Windows Forms ? Is it opening, working with and closing a new
SQLconnection and SQLcommand object everytime a DB access is needed , or
maintaining a single open connection/command object at the application level
( one for each user ) and then just reusing it again and again. The
connection string that the connection will use can be assumed to be static.

Signature

Vedanshu Mandvikar

C.C. (aka Me) - 27 Jan 2006 00:04 GMT
It depends on what your requirements are.

If your user will be making a lot of changes/queries in a short amount of
time then it is probably better to keep the connection open.

If they perform a query and then process the datal locally for a while
before interacting with the DB again then it might be better to close it and
reopen when it as needed.

Keeping a connection open, when it is not going to be used for a while, is a
waste of server resources on the DB side.

Signature

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Charles Cox
VC/VB/C# Developer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> Hi EveryOne,
>
[quoted text clipped - 6 lines]
> connection string that the connection will use can be assumed to be
> static.

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.