MVC-ASP.NET-如何在不使用ADO.NET实体数据模型的情况下与数据库连接 [英] MVC-ASP.NET - How to connect with DB without using ADO.NET Entity Data Model

查看:177
本文介绍了MVC-ASP.NET-如何在不使用ADO.NET实体数据模型的情况下与数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我可以在
中查看数据库记录 MVC-使用ADO.NET实体数据模型的ASP.Net应用程序.我担心的是,是否有任何其他方法可以在不使用ADO.NET实体数据模型(.edmx文件)/LINQ to SQL(.dbml)的情况下连接数据库
喜欢层方法吗?(DAL)

请回复.

-
YRishi

Dear All,

I am able to view database records in
MVC - ASP.Net application using ADO.NET Entity Data Model. My concern is, is there any other way to connect with database without using ADO.NET Entity Data Model(.edmx file)/LINQ to SQL(.dbml)
Like layer approach?(DAL)

Please reply.

-
YRishi

推荐答案

是的,还有其他方法可以使用Linq到Sql
在下面链接此链接

LINQ to SQL:高级概念和功能 [ ^ ]
yes there is other way you can use Linq to Sql
Clink this link below

LINQ to SQL: Advanced Concepts and Features[^]


是的,您可以使用任何想要的东西!

MVC并不限制您可以使用的数据访问策略的类型,MVC和数据访问是两个完全独立的东西.

您可以创建另一个执行所有数据访问(DAL)的项目,并从MVC Web项目中引用该项目,然后再使用.在您的DAL中,您可以只定义SqlConnection对象或任何您喜欢的对象,选择就是您自己的!
Yes, you can use anything you want!

MVC doesn''t limit you to the type of data access strategy you can use, MVC and data access are two completely separate things.

You could create another project that performs all your data access (DAL), reference that from your MVC web project and away you go. Within your DAL, you could just define SqlConnection objects or whatever you like, the choice is yours!


这篇关于MVC-ASP.NET-如何在不使用ADO.NET实体数据模型的情况下与数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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