Custom Class Binding to Database

Posted on 2006-04-14
Last Modified: 2010-04-23

Once I am finished using a custom class what is the best way to update and/or insert the values from the class to a table in the database?

Question by:redmountainmachinery
    LVL 14

    Assisted Solution

    You could implement a Store method in your class and create a insert/update query.
    If you remember the Primary key in your class, you can determine if you need to insert or update.
    After you inserted, store the newly generated PK in your class....

    LVL 2

    Accepted Solution

    Hello redmountainmachinery ,
                   As you would like to implement the OOPS concepts with the object class. I would definitely suggest you to write methods inside the class for updation and insertion seperately which accepts necessary arguments respectively.

    Instantiate the class created and use the method inside it to update the data or insert it.

     If you want more of it reply with requirements.


    Author Comment

    I was thinking what you guy suggested...
    I just wanted to make sure there wasn't another way



    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video discusses moving either the default database or any database to a new volume.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now