Do you have to worry about database connection state in ASP.NET ? Why ?

Questions by NithyaSurendran

Showing Answers 1 - 9 of 9 Answers

Well, .NET 2.0 will provide different way to use to connect to database server. Definately the server side will be heavy in terms of processing if we use database connection state. Perosnally I prefered to go for connection mode status.If this is not clear then you can contact me aloksaxena01@yahoo.com

  Was this answer useful?  Yes

shree

  • Dec 24th, 2006
 

yes we have to worry becaz there are lot of reasons i will explain with scenarios.

Let we have written the code in the try block where we have connected to the db and there is exception occured.Now the connection is opened and we should be very carefull that the connection is closed in the catch block else it will remain open.

  Was this answer useful?  Yes

Robert

  • Apr 10th, 2007
 

try{Connection.Open()}
catch{...}
finally{ Connection.Close()}

The finally block will ALWAYS execute regardless of exception.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions