code_junkie

Does End Using close an open SQL Connection

Nov 13th, 2011
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. using cn as new system.data.sqlclient.sqlconnection()
  2. cn.open
  3. '{do a bunch of other stuff with commands and datareaders here}
  4. cn.close 'Do I need this?
  5. end using
  6.  
  7. Try
  8. SqlConnection cn as new system.data.sqlclient.sqlconnection()
  9. cn.open
  10. '{do a bunch of other stuff with commands and datareaders here}
  11. cn.close 'Do I need this?
  12. Finally
  13. cn.Dispose()
  14. End Try
Add Comment
Please, Sign In to add comment