Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

Custom Class Binding to Database


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?

0
redmountainmachinery
Asked:
redmountainmachinery
2 Solutions
 
PockyMasterCommented:
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....

0
 
manojkumarpsCommented:
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.

Regards,
Manoj
0
 
redmountainmachineryAuthor Commented:
I was thinking what you guy suggested...
I just wanted to make sure there wasn't another way

Thanks

Chuck
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now