|
-
Apr 21st, 2005, 06:16 PM
#1
Thread Starter
Member
Multiple try catch
Hello all, in my app which connects to a database....I have multiple buttons, or places where I need to run a query, im using this to connect and issue a query:
VB Code:
try
{
//connect to database and run query
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
In my code it seems im just copying and pasting that in multiple spots, but running a different query, anyone have any ideas on how to optimize this? Maybe create a function to connect and such, but i'm not sure how...any suggestions? Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|