GeekInterview.com
Series: Subject: Topic:
Question: 151 of 348

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

Asked by: NithyaSurendran | Member Since Oct-2006 | Asked on: Oct 26th, 2006

View all questions by NithyaSurendran

Showing Answers 1 - 3 of 3 Answers
aloksaxena01

Answered On : Nov 9th, 2006

View all answers by aloksaxena01

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

  
Login to rate this answer.
shree

Answered On : 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.

  
Login to rate this answer.
Robert

Answered On : Apr 10th, 2007

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

The finally block will ALWAYS execute regardless of exception.

Yes  1 User has rated as useful.
  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.