如何使用ADO.NET从数据库中选择,插入,更新,删除 [英] how to do select, insert, update, delete from database using ADO.NET

查看:77
本文介绍了如何使用ADO.NET从数据库中选择,插入,更新,删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用ADO.NET从数据库中进行选择,插入,更新,删除而不是ADO.NET实体对于某些rais可能任何人都可以帮助我这个只是一些链接或例子

我正在使用asp.net mvc 4 razor

Hi, i want to do select, insert, update, delete from database using ADO.NET and not ADO.NET Entity for some raisons plz can anyone help me with this just some link or exemples
i'm using asp.net mvc 4 razor

推荐答案

http://www.c-sharpcorner.com/UploadFile/1492b1/complete-crud-operations- in-mvc-4-using-entity-framework-5-w /



使用实体框架5在MVC 4中完成CRUD操作而无需编写单行代码 [ ^ ]



使用MVC中的存储库模式进行CRUD操作 [ ^ ]





[ ^ ]



看到它



它会帮助你
http://www.c-sharpcorner.com/UploadFile/1492b1/complete-crud-operations-in-mvc-4-using-entity-framework-5-w/

Complete CRUD Operations in MVC 4 using Entity Framework 5 Without Writing a Single Line of Code[^]

CRUD Operations Using the Repository Pattern in MVC[^]


[^]

see it

it will help you


这个下面的链接给你一个正确的开始路径:



http:// stackoverflow.com/questions/6694098/using-asp-net-mvc-with-classic-ado-net



[ Youtube视频]



希望您对此链接有所帮助。
This below link give you a correct path to start with :

http://stackoverflow.com/questions/6694098/using-asp-net-mvc-with-classic-ado-net

[Youtube Video]

Hope you will be helpful with this link.


如果您不想在那里使用Entity Framework还有很多其他(ADO-base)选项。如果您关心的话,它们中的大多数都会引入与EF一样多的开销,但如果您只想要纯SQL访问,则可以使用System.Data.SqlClient命名空间。使用SqlConnection和SqlCommand手动进行数据库调用和更改。



当然这会导致代码紧密耦合,您将丢失默认的模型绑定器。您需要在控制器中重建这些或手动卡纸。实际上你会拿到M而只剩下VC。
If you don't want to use Entity Framework there are many other (ADO-base) options. Most of them introduce just as much overhead as EF, if that's your concern, but if you want just plain SQL access you can use the System.Data.SqlClient namespace. Use the SqlConnection and SqlCommand to manually make database calls and changes.

Of course this will result in tightly coupled code and you'll lose the default model binders. You'll need to either rebuild those or hand-jam in your controllers. Effectively you'll take the M and just be left with VC.


这篇关于如何使用ADO.NET从数据库中选择,插入,更新,删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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