The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Visual Studio.net (VB6) by McGowan2005-02-14 06:25:51
  Try this by NCBob274092005-02-14 07:34:11
    And put the ExecuteNonQuery inside a "try", with by bwkaz 2005-02-14 14:49:51
the <blah blah blah>.Connection.Close() inside a corresponding "finally". There's really no need to "catch" any type of exception; you just want to make sure the connection gets closed one way or the other.

This way, you don't accidentally leave the connection open if (when) a problem happens while inserting the row into the database. Duplicate values in primary keys happens to me every once in a while, and forgetting to provide values for some required fields also happens every once in a while.
[ Reply ]

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)