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. .NET (Core and Framework)
  4. class from database table

class from database table

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpdatabasetoolsquestion
7 Posts 5 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.
  • S Offline
    S Offline
    seanwright
    wrote on last edited by
    #1

    Hey all, I was wondering if there was a utility to generate c# classes from database tables?

    L S P M 4 Replies Last reply
    0
    • S seanwright

      Hey all, I was wondering if there was a utility to generate c# classes from database tables?

      L Offline
      L Offline
      led mike
      wrote on last edited by
      #2

      seanwright wrote:

      I was wondering if there was a utility to generate c# classes from database tables?

      Are you talking about Object-Relational mapping?[^]

      led mike

      1 Reply Last reply
      0
      • S seanwright

        Hey all, I was wondering if there was a utility to generate c# classes from database tables?

        S Offline
        S Offline
        Scott Dorman
        wrote on last edited by
        #3

        Yes, there are several. Search for "Object Relational Mapper" or "O/RM". Some that come to mind are NHibernate, SubSonic, and the ADO.NET Entity Framework.

        Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


        [Forum Guidelines] [Articles] [Blog]

        S 1 Reply Last reply
        0
        • S Scott Dorman

          Yes, there are several. Search for "Object Relational Mapper" or "O/RM". Some that come to mind are NHibernate, SubSonic, and the ADO.NET Entity Framework.

          Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


          [Forum Guidelines] [Articles] [Blog]

          S Offline
          S Offline
          seanwright
          wrote on last edited by
          #4

          I've been looking at O/RM for a while. I guess I'm just looking (right now) at creating custom collection classes based of data from a database. Now, I don't want every column from the table I'm querying, just a few key columns. So basically I'm looking for a utility which will generate a class and I'll just delete what I don't need afterwards. Make sense?

          S 1 Reply Last reply
          0
          • S seanwright

            I've been looking at O/RM for a while. I guess I'm just looking (right now) at creating custom collection classes based of data from a database. Now, I don't want every column from the table I'm querying, just a few key columns. So basically I'm looking for a utility which will generate a class and I'll just delete what I don't need afterwards. Make sense?

            S Offline
            S Offline
            Scott Dorman
            wrote on last edited by
            #5

            Yes, that makes sense. Take a look at http://SubSonic[^] as I think it will allow you to do what you want.

            Scott. —In just two days, tomorrow will be yesterday. —Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai


            [Forum Guidelines] [Articles] [Blog]

            1 Reply Last reply
            0
            • S seanwright

              Hey all, I was wondering if there was a utility to generate c# classes from database tables?

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              If you want to use Linq, there's always SqlMetal.

              Deja View - the feeling that you've seen this post before.

              My blog | My articles

              1 Reply Last reply
              0
              • S seanwright

                Hey all, I was wondering if there was a utility to generate c# classes from database tables?

                M Offline
                M Offline
                Mark Churchill
                wrote on last edited by
                #7

                Generators are great until you modify the generated code, and then you are stuck maintaining it. I, of course, recommend Diamond Binding[^] for an end-to-end ORM solution. We plug into VS, and are probably the fastest to get off the ground with. (Check the example section) Subsonic use a build provider approach which is quite reasonable. Subsonic also provides some UI framework, which is either a blessing or a curse, depending on how you feel about separation of concerns. NHibernate is great, but difficult to use. Diamond Binding uses NHibernate to do the heavy lifting behind the scenes. But avoid code-generators like the plague, they tend to give you a very inflexible model, which can be difficult to extend.

                Mark Churchill Director Dunn & Churchill Free Download:
                Diamond Binding: The simple, powerful, reliable, and effective data layer toolkit for Visual Studio.

                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