Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Creating separate class for database connection MFC vc++

Creating separate class for database connection MFC vc++

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasequestionlearning
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_14575556
    wrote on last edited by
    #1

    I have created a simple dialog application where it can perform crud operations but how I did it was I open a connection an do some operations inside most of the buttons as I'm still starting out as a beginner(noob). What will be a good approach to separate all the database related operations in another class? or keeping as it is, is it a good practice? I would like some suggestions. Thank you.

    L D 2 Replies Last reply
    0
    • M Member_14575556

      I have created a simple dialog application where it can perform crud operations but how I did it was I open a connection an do some operations inside most of the buttons as I'm still starting out as a beginner(noob). What will be a good approach to separate all the database related operations in another class? or keeping as it is, is it a good practice? I would like some suggestions. Thank you.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Since you're asking the question, you probably already know the answer.

      The Master said, 'Am I indeed possessed of knowledge? I am not knowing. But if a mean person, who appears quite empty-like, ask anything of me, I set it forth from one end to the other, and exhaust it.' ― Confucian Analects

      1 Reply Last reply
      0
      • M Member_14575556

        I have created a simple dialog application where it can perform crud operations but how I did it was I open a connection an do some operations inside most of the buttons as I'm still starting out as a beginner(noob). What will be a good approach to separate all the database related operations in another class? or keeping as it is, is it a good practice? I would like some suggestions. Thank you.

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        I did something similar here. It may not be exactly what you are after, but it does give you another perspective, which could ultimately get you to your goal.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups