user6321125
user6321125

Reputation: 137

asp.net mvc c# with sql without ORM

So I have to make a asp.net project with SQL Server database, the problem is that I have to do it without any ORM-with a specific DB controller and I have always used the Entity Framework which IS an ORM.

I have no idea from where to begin. How do I collect the data and send it the controller with the html.helpers and how to structure the db controller?

I am not allowed to use Linq either just SQL. As much as I can see from the others questions I should use the SQL command class but its not explained structurally.

What I am asking here is just for the basics.How do I get it from the html helper to the database without ORM and what will I need for that as clases and models,how to relate them and if possible for a simple example.

Upvotes: 2

Views: 2783

Answers (1)

Seb Krae
Seb Krae

Reputation: 311

As you mentioned, you can use "classic" SQL commands with ADO.NET. Here is a good example: Using ASP.Net MVC with Classic ADO.Net

Another way, and in my opinion a very fast and convenient way, is to use the Dapper framework. I would recommend you to use Dapper with Stored Procedures. It's a good trade-off between ORM (like Entity Framework) and classical SQL commands. I can show you an example if you give me a business case.

Upvotes: 6

Related Questions