ejagkrch
ejagkrch

Reputation: 35

ADO.net data access srtategy in MVC application

This is not really related to Programming But I do need a answer for that if anyone know. What are the ADO.net Data access strategies for MVC application. choices are 1-DataAdapter 2-Datareader 3-EntityFramework 5-LinqtoSQL

I know that there is a DataReader that provides stream of data from the data source and DataAdapter provides the bridge between the DataSet object and the data source but not sure if that is call Data access strategy, I know Linq to SQL and EntityFramework are the Strategies. Please help

Upvotes: 0

Views: 1580

Answers (2)

SBirthare
SBirthare

Reputation: 5137

Data Access Technology

SQL data access options available in .NET framework are; Entity Framework, LINQ to SQL and SQL client.

Solution

  1. SQL client

SQL client requires writing custom queries or stored procedures for each data access operations and extra code work to convert them into .NET objects. This technique will be beneficial when complex and dynamic queries are used very often. SQL client provides the best performance of these three technologies but requires maximum development and maintenance effort.

  1. LINQ to SQL

LINQ to SQL provides a simple mechanism to access SQL database and keeps development effort to minimum, but not suitable for complex data structure. Query performance generally will be slower compared to SQL client.

  1. Entity Framework

Entity Framework provides a balance between LINQ to SQL and SQL client. It supports complex data mappings and by implementing proper Repository pattern, we can abstract the storage mechanism from business layer easily.

Selected Approach

Based on the above observations (in particular: support for complex data mappings; and simpler implementation) the proposed solution is to use Entity Framework for data access.

Note: The above description was written few years ago and may not be up-to-date. Thought it might help.

Upvotes: 1

user3567028
user3567028

Reputation: 41

System.Data classes are need to detailed management data storage of your app. System.Data.Entity or Linq to SQL its more simply to using in small projects.

Upvotes: 0

Related Questions