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?
There is nothing wrong with using the ADO.NET base classes.
, . , , 10 SqlCommand SqlDataReader, , (, , ..), , . , .
ORM , " " . , 10 - "". ORM ( , SqlCommand, SqlDataReader), , "Customer" , , - Customer.
, ADO.NET, , , , ORM , .
, ORM, , SQL-, :)
-, ORM - "" DAL, .
, , ORM, , , , , ORM . , :)
ORM . , , , , , , SQL-, . ORM, , .
, . , , sql, , , , , , . , , , .
, !
. SqlConnection, SqlCommand .. , .
DB, , .
: " " OR/M ?
, - . OR/M, nHibernate /, ADO.NET.
OR/M, XML- , ... , , # . 58 , 58 XML, 50 . , / CRUD 58 ADO.NET.
. , , , , , , , , . , nHibernate. o jo .
, ORM . ORM - -. , - ORM . , . , ADO.NET ( ), ORM- - . - .
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.
Source: https://habr.com/ru/post/1719999/More articles:Python - переписать __getattribute__ для экземпляра? - pythonЗапускать asp.net mvc ajax обновлять автоматически каждые X минут - asp.net-mvcBlack berry table - user-interfaceDuplicate dataset in SQL Server - sqlWhy is C ++ not offered as code for asp.net? - c ++Checking files with AnkhSVN, which does not require entering a FogBugz number - tortoisesvnUsing a diagram in four aspects in aspect-oriented programming? - javaStructuring the program. Classes and functions in Python - pythonGet a Win32 program to request a debugger at startup? - c ++C # Creating a Log System - c #All Articles