如何进行类和SQL基本查询 [英] How to make classes and SQL basic queries

查看:107
本文介绍了如何进行类和SQL基本查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨老年人我在我的SQL数据库中有很多表,并希望通过代码创建他们的类是可能的。我不想使用实体框架,因为它在项目目录的根目录上创建了许多不需要的东西在里面 。我只需要根据表格列的具有属性的简单类。



我尝试了什么:



我使用Object Relational Modal软件就像实体框架一样。

解决方案

不知道这是否符合你的需要,但它是一个该死的好CodeProject文章: DataTable Mapper的通用集合 [ ^ ]



Linq to SQL 可能是另一种选择: LINQ教程:将表映射到对象 [ ^ ]

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.

解决方案

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[^]


这篇关于如何进行类和SQL基本查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆