Manually connecting to database in Asp.net MVC

2019-08-28 04:31发布

问题:

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

回答1:

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.