469,344 Members | 6,633 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

Should I write database connectivity code each time ?

I have a form with buttons 'View', 'Save', 'Delete', 'Edit' and some textboxes to input data.. On clicking each buttons the database is connected and the respective action is done. For example clicking on Save button inserts records, clicking on Delete button delete the specified record and clicking on View button the record from database table is fetched etc.
So my question is

1. Should I write the database connectivity code and the corresponding action code repeatedly in each button's click event

or

2. Should I write the database connectivity code once in forms's load event and the action code only in each button's click event. which is better..please suggest.
Sep 7 '07 #1
0 1076

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by junaid | last post: by
3 posts views Thread by Niks | last post: by
2 posts views Thread by Bob | last post: by
47 posts views Thread by Ivan Weiss | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.