concept ADO.NET in category asp.net

appears as: ADO.NET
ASP.NET 4.0 in Practice

This is an excerpt from Manning's book ASP.NET 4.0 in Practice.

An ORM is a framework that lets you build applications based on a paradigm that’s completely different from the one you use when you work directly with ADO.NET. You can just work with objects and ignore the database.

An ORM lets you map your classes and properties against tables and columns in the database. You can design your classes and tables independently and then let the ORM do the dirty work of using the mapping information to generate SQL code to read data from a database, create objects with it, and persist data inside objects in the database. The SQL code is then executed through ADO.NET, which remains at the lowest layer.

Throughout this book, we’ve used Entity Framework to access data stored in a database. Although it’s recommended, Entity Framework isn’t the only choice for retrieving data. A good alternative is to use ADO.NET. Entity Framework itself leverages this component. ADO.NET is easy to use, but you have to manually handle the connection to the database, the command to execute queries, and the transaction to execute multiple update commands. Finally, data isn’t returned as objects but as a generic-purpose container. All these features make ADO.NET simple but extremely code intensive. That’s why Entity Framework is the recommended approach.