CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2014
    Posts
    1

    Question 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.

  2. #2
    Join Date
    Jul 2003
    Location
    PA
    Posts
    124

    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;
    There are 10 types of people in the world, those that understand binary and those that don't.
    Using VS 2010

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    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.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured