TechArena Community

TechArena Community (
-   Software Development (
-   -   Close ended Database connection in CSharp. (

Elton John 12-01-2011 06:50 PM

Close ended Database connection in CSharp.
I am working as a software developer in a small IT company. Up till now in all my projects I used only normal database connection we normally used in vb6.0. But in current working projects client told me that while coding be careful about one thing that is not to give too much pressure on server if they found that my application is putting lot of pressure on their server interacting with data stored in database than they will refuse my project. I only know the normal method of connectivity. Please reply as soon as possible I want to complete my project as soon as possible.

Vandam 12-01-2011 06:53 PM

Re: Close ended Database connection in CSharp.
It is not an issue for which you stopped your process of development. There are two types of connection techniques available in c#. One is open ended connection and second is close ended connection. Open ended connection is one which is you used. In open ended connection you remain in contact of server as long as you are interacting with database. But in close ended connection you take a copy of database on your local machine and close the connection. For taking a copy of database you just need to create one object of dataset in that with the help of data adapter da.fill (dataset object, table name). You can then update the changes you made on your copy to database using data adapterers Update method.

Dwarner 12-01-2011 06:54 PM

Re: Close ended Database connection in CSharp.
Yes! There is an alternative to open ended connection technique that you are using which puts tremendous pressure on your server where you?re all data is placed. Close ended tech. put?s less pressure on server side. Just one thing on which you have to concentrate is not use close ended connections technique when there is a requirement of reflecting the changes in database as soon as you perform some action in your application so be clear when to use what.

Jacques25 12-01-2011 06:55 PM

Re: Close ended Database connection in CSharp.
Close ended connection will definitely solve your problem regarding connection. There is a same method to use in all type of connections that you establish with server. It may be sqlserver or any other. Method is unique for all types of connections. Just one difference is there that is after taking copy of database on dataset don?t try to put it another database into it use different dataset object for dealing with new database.

All times are GMT +5.5. The time now is 01:25 PM.