Best way to write database routines
Hi,
Thanks for any and all help in advance.
I am writing a new version of my back office system and am moving it from VB.Net to C#.
I'd like to know the best way to group all my database routines so that I can use 1 set of functions through out my program to retrieve data.
I have the following forms:-
Form1 - Main Form that will display and allow printing and updating of orders
Order Details - Views a specific order details
Complete Order - Allows to close an order with specific information
Messages - Views and allows user to reply to patients
Notes - Views and allows user to write notes to other users
Comments - Views and allows users to write comments about the customer
Now, in my VB.Net program, I use a "Module.Bas" file to do all my calls from each of the form files. But, I'd like to know if it would be best:-
db_functions.class
print_functions.class
So that I can then segment the code and try to make the system work more efficiently.
What would I add to my project so that I could call "db_functions.class" (or whatever I should create) from each of the forms to get/set data? Also, I do need to "talk" to 3 MySQL Databases.
Cheers
Carl.
Re: Best way to write database routines
Make your own class file with all your custom functionality and add it to your project. Ensure the file is included in the project and hook using the namespace:
using my_namespace_class;
Re: Best way to write database routines
Print is under the Function class, and can't call or program against it. The Print class can be called by *some* parts of the Function class. Keeps things separate.