1

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.

user6321125
  • 117
  • 1
  • 11
  • 1
    Look through Artist, Exhibition, or Objects controllers here and you can see how it is done: https://github.com/smoore4moma/tms-api/tree/master/tms-api/Controllers – smoore4 May 30 '16 at 08:37
  • 1
    explore oledbconnection namespace, be excited on your task, ORM sometimes made us lazy forgetting about some important tasks since it is already wrapped – DarkMakukudo May 30 '16 at 08:38

1 Answers1

5

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.

Seb Krae
  • 191
  • 2
  • 10
  • + 1 yah dapper is also good when it comes to performance, the only downside is to write that very long codes :) – DarkMakukudo May 30 '16 at 08:43
  • Dapper is a great choice especially if you have to leverage something that doesn't have an EF provider. – Alan B May 30 '16 at 14:14