Connection Object....

  • Thread starter Thread starter Nelson Smith
  • Start date Start date
N

Nelson Smith

To make my application more efficient whenever I use database connection I
am calling the following statements.

Do I miss some statements or some of them are redundant?

I am using .Net Framework 1.1.



cnnSQL.Close()

cnnSQL.Dispose()

cnnSQL = Nothing



Thanks

Nelson
 
cnnSQL.Close() is all you'll ever need, and you don't even need that in some
cases.
All the rest are redundant.
 
cnnSQL.Close() is all you'll ever need, and you don't even need that in
some

Or cnnSQL.Dispose(). Using either of them will do the trick. Using both, as
Steve says, is redundant. And setting ANY class instance to Nothing does
exactly that: Nothing. Well, it DOES waste a few processing cycles, but
nothing to write home about.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
I get paid good money to
solve puzzles for a living
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top