Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Classic ADO.NET still used?

Is classic ADO.NET still widespread and in use with many developers out there inserting, reading data etc?

Even though we now have LINQ and EF.

like image 637
TeaDrinkingGeek Avatar asked Apr 07 '11 15:04

TeaDrinkingGeek


People also ask

Is ADO.NET outdated?

It isn't obsolete, it is the foundation for working with databases in . NET.

Is ADO.NET is the next version of ADO?

ADO.NET is an advance version of ADO. It interacts with databases and have a consistent access to various data sources.

Is ADO.NET faster than Dapper?

In short, Dapper.NET is slightly faster than straight ADO.NET.

Is ADO.NET supported in .NET core?

Both are supported on . NET Core. Use classic ADO.NET for performance, to maintain existing code that already uses it, and ...


3 Answers

Yes it is still used in some situations.

At my day job we have a couple cases where we use SQL Bulk Copy which requires good ole' Connections and Commands.

Additionally, there are some new datatypes in SQL 2008 R2 (Geography, Geometry, Hierarchy) that don't have support in Entity Framework. In those cases, one approach is to go back to the actual Ado.Net.

Is there a specific case that you're interested in, or is this a more general question?

EDIT Another case would be performance. There is a higher ability to fine tune the SQL for optimal performance that tools such as EF don't get you. This case is rarer than the other reasons for using Ado.Net, but it is still a valid case.

like image 88
taylonr Avatar answered Nov 15 '22 06:11

taylonr


Yes, absolutely!

EF and Linq-to-SQL are great for most line-of-business apps and operations - but they both don't work very well for e.g. bulk operations (like bulk inserts etc.), where using "straight" ADO.NET is your best bet.

Also, certain things aren't supported by EF/L2S - like new SQL Server 2008 datatypes such as the spatial datatypes. Also, neither EF nor L2S support dealing with stored procedures that return more than one result set at once.

So yes: there's definitely still room for "classic" ADO.NET to "fill the gaps" where EF/L2S or other technologies don't really offer anything useful.

like image 26
marc_s Avatar answered Nov 15 '22 06:11

marc_s


Older applications still use classic ADO.Net. There is alot of older 3.0 and earlier code that uses it and it may not be cost effective to migrate it to EF or LINQ to SQL.

like image 40
BRaul Avatar answered Nov 15 '22 08:11

BRaul