手动连接到数据库中Asp.net MVC [英] Manually connecting to database in Asp.net MVC

查看:137
本文介绍了手动连接到数据库中Asp.net MVC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能使用的SqlClient和的SqlConnection(即标准ADO.net方式)手动连接到数据库,而不是使用LINQ或实体框架在Asp.Net MVC?

Is it possible to manually connect to the database using sqlclient and sqlconnection (ie standard ADO.net way) instead of using LINQ or Entity Framework in Asp.Net MVC?

请指引我
谢谢

Please guide me Thanks

推荐答案

是的。没有什么魔术有关MVC在这方面。您只需建立连接和命令,你会在过去你的操作方法,并填写你的DataTable的方式。

Yes. Nothing magic about MVC in that regard. Just create your connection and command the way you would have in the past in your action method and fill your DataTable.

这篇关于手动连接到数据库中Asp.net MVC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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