How to create an appropriate database level?

Currently, I use many ado.net classes (SqlConnection, SqlCommand, SqlDataAdapter, etc.) to make calls to our sql server. It is a bad idea? I mean this works. However, I see many articles that use ORM, nHibernate, subsonic, etc. To connect to SQL. Why are they better? I'm just trying to figure out why should I even change this?

Update:

I checked the following guide on using nHibernate with stored procedures.

http://ayende.com/Blog/archive/2006/09/18/UsingNHibernateWithStoredProcedures.aspx

However, it seems to me that this is a way to outwit. Why do I need to create a mapping file? Even if I create a mapping file and say that my table is changing, then my code will no longer work. However, if I use ado.net to return a simple data type, then my code will work. Am I missing something?

+3
source share
7 answers

There is nothing wrong with using the ADO.NET base classes.

, . , , 10 SqlCommand SqlDataReader, , (, , ..), , . , .

ORM , " " . , 10 - "". ORM ( , SqlCommand, SqlDataReader), , "Customer" , , - Customer.

, ADO.NET, , , , ORM , .

+3

, ORM, , SQL-, :)

-, ORM - "" DAL, .

, , ORM, , , , , ORM . , :)

+1

ORM . , , , , , , SQL-, . ORM, , .

, . , , sql, , , , , , . , , , .

, !

+1

. SqlConnection, SqlCommand .. , .

DB, , .

0

: " " OR/M ?

, - . OR/M, nHibernate /, ADO.NET.

OR/M, XML- , ... , , # . 58 , 58 XML, 50 . , / CRUD 58 ADO.NET.

. , , , , , , , , . , nHibernate. o jo .

0

, ORM . ORM - -. , - ORM . , . , ADO.NET ( ), ORM- - . - .

0

There is nothing wrong with using direct ADO.Net, but using ORM can save you time in both development and maintenance. This is the biggest advantage.

0
source

Source: https://habr.com/ru/post/1719999/


All Articles