SQLCommand / SQLConnection vs OleDbCommand / OleDbConnection

Does it make sense to use SQLCommand / SQLConnection instead of OleDbCommand / OleDbConnection . Do I get any benefits from this in terms of API usability, functionality, performance or security? Or any other perspective?

+5
source share
2 answers

OleDbCommand and OleDbConnection are shared. SqlCommand and SqlConnection specific to SQL Server and can take advantage of their features. They also reveal the capabilities of SQL Server. For example, you can use them to manage XML columns.

+5
source

with sqlconnection you can use transactions and transaction areas, for example:

 using(var scope = new TransactionScope()) { //do a lot of stuff with sqlconnection/sqlcommand (s) scope.Complete() } 

you need to enable msdtc service for this.

take a look at http://valueinjecter.codeplex.com/ , on the data access level page where I display this

+1
source

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


All Articles