Click here to Skip to main content
15,845,598 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi seniors i have many tables in my SQL database and want to make their classes through code is it possible .I don't want to use entity framework as it creates the classes on the root of the project directory and many unwanted thing in it . I just need the simple classes with attributes according to the table columns.

What I have tried:

I was using Object Relational Modal software's to do this like entity framework.
Updated 21-Mar-18 10:17am
MadMyche 21-Mar-18 15:03pm    
You can move the generated classes to anywhere within the project file structure. You can also rename the namespace hierarchy if you so desire.
Other ORMs are going to exhibit similar behavior.

I myself do parallel development of tables to classes; copying the "create" script into excel, a little manipulation, and creating the class definition from there

1 solution

Don't know if this will suit your needs, but it is a damned good CodeProject article: A generic Collection to DataTable Mapper[^]

Linq to SQL might be another option: A LINQ Tutorial: Mapping Tables to Objects[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900