ASP.NET Data Access Content Map
This topic provides links to documentation resources about how to access data in ASP.NET web applications, primarily by using the Entity Framework and SQL Server.
This topic contains the following sections:
Get Started with ASP.NET & ASP.NET MVC (If you haven’t worked with ASP.NET, start here for a basic introduction.)
Relational database (Wikipedia site. If you haven’t worked with relational databases, see this page for an introduction to relational database terminology and concepts. For an introduction to SQL Server in particular see Working with SQL Server databases later in this topic.)
ASP.NET Data Access Options (An introduction to data access options for ASP.NET and guidance on how to choose the ones that are appropriate for your scenario.)
Entity Framework Development Approaches (Guidance on how to choose an Entity Framework development approach Database First, Model First, or Code First.)
Getting Started with EF 4.1 using MVC 3 (ASP.NET site. Covers a wide range of Entity Framework Code First scenarios but does not include Migrations.)
Introduction to ASP.NET MVC 4 (ASP.NET site. Covers a narrow range of Entity Framework Code First scenarios but does include Migrations. For Migrations, see also Using Entity Framework Code First Migrations.)
Model Binding and Web Forms (tutorial series)
Getting Started with ASP.NET 4.5 Web Forms - Introduction. (ASP.NET site. This tutorial set is not mainly about how to use Entity Framework but it includes tutorials that use Code First.)
Entity Framework - Code First to an Existing Database (Video and walkthrough that shows how to use Code First with an existing database.)
Deploying an ASP.NET Web Application to a Hosting Provider using Visual Studio or Visual Web Developer (ASP.NET site. Tutorial series that shows how to use Code First Migrations to deploy a database.)
Web Deployment Overview for Visual Studio and ASP.NET (See the Configuring Database Deployment in Visual Studio section for an explanation of how Code First Migrations is integrated into Visual Studio web deployment features.)
For current resources on using the Entity Framework designer, see the MSDN Data Developer Center. See also the Books about the Entity Framework and Other Entity Framework resources sections in this document.
The following resources are older. They are useful if you want to use version 4.0 of the Entity Framework, and you want to use a data source control for data binding in a Web Forms application.
Getting Started with the Entity Framework 4.0 (ASP.NET site. Shows how to use the EntityDataSource control.
Continuing with the Entity Framework (ASP.NET site. Shows how to use the ObjectDataSource Control. Includes a tutorial on concurrency handling, a tutorial on EF performance, and a tutorial on what's new in EF 4.0.
Reading Related Data with the Entity Framework in an ASP.NET MVC Application (ASP.NET Site. Code First, MVC sample application. The methods shown apply also to Web Forms model binding.)
Advanced Entity Framework Scenarios for an ASP.NET Application (ASP.NET site. Shows how to execute your own SQL statements or call your own stored procedures, how to disable change detection, and how to disable validation when saving changes.)
Maximizing Performance with the Entity Framework in an ASP.NET Web Application (ASP.NET site. Applies to Entity Framework 4.0.)
See also Optimizing ASP.NET data access.
Handling Concurrency with the Entity Framework in an ASP.NET MVC Application (ASP.NET site. Code First, DbContext API, using an MVC sample application.)
Handling Concurrency with the Entity Framework in an ASP.NET Web Application (ASP.NET site. Applies to Entity Framework 4.0. Database First, ObjectContext API, using a Web Forms sample application.)
Programming Entity Framework: DbContext by Julie Lerman and Rowan Miller
Programming Entity Framework: Code First by Julie Lerman and Rowan Miller
Both of these books are up-to-date with the most current recommended techniques, and they provide a much more comprehensive yet easy-to-follow introduction to the Entity Framework than anything available on the Internet. Another book, Programming Entity Framework by Julie Lerman, is larger and more comprehensive but it is older and many of the techniques it covers are no longer the recommended way to use the Entity Framework.
Entity Framework (ADO.NET) team blog (One of the best resources for the most current information and announcements of new enhancements.)
Julie Lerman's blog (Julie Lerman is the author and co-author of several Entity Framework books and courses, and her blog is another good source for current information and announcements.)
MSDN Magazine (See the Data Points column, which is frequently about topics related to the Entity Framework.)
The following blogs are by members of the Entity Framework team at Microsoft. They are not as frequently updated as the team blog.
Model Binding and Web Forms (ASP.NET tutorial series)
Web Forms Model Binding Part 1: Selecting Data (Scott Guthrie's blog. In these older blog posts, the property that is currently named ItemType was named ModelType, but otherwise the information they contain is valid.)
Web Forms Model Binding Part 2: Filtering Data (Scott Guthrie's blog)
Web Forms Model Binding Part 3: Updating and Validation (Scott Guthrie's blog)
ASP.NET 4.5 Web Forms Model Binding (ASP.NET site video)
Model Binding Part 1 - Selecting Data (ASP.NET site video)
Model Binding Part 2 - Filtering (ASP.NET site video)
Model Binding and Web Forms (ASP.NET tutorial series)
Strongly Typed Data Controls (Scott Guthrie's blog)
Data-Binding Expressions Overview (This page only covers Eval and Bind; it has not been updated to include Item and BindItem.)
ASP.NET 4.5 Web Forms Strong Typed Data Controls (ASP.NET site video)
SQL Server Database Features (A general introduction to SQL Server.)
Microsoft SQL Server: Database Product Samples (Sample AdventureWorks databases on the CodePlex site.)
Installing Sample Databases (CodePlex site. In addition to the methods shown here, you can also download one of the sample .mdf files to the App_Data folder of a web project, convert the database to LocalDB, and create a LocalDB connection string. For information about how to do that, see Working with SQL Server Express LocalDB databases.)
See also the following sections on working with SQL Server Express and LocalDB, and choosing between SQL Server and SQL Database.
How to: Upgrade to LocalDB (How to migrate an .mdf file from an earlier version of SQL Server Express to LocalDB. You also have to go through this process if you download one of the SQL Server 2012 sample databases.)
Introducing LocalDB, an improved SQL Express (SQL Server Express blog)
LocalDB: Where is My Database? (SQL Server Express blog)
Using LocalDB with Full IIS, Part 1: User Profile (SQL Server Express blog)
SQL Server Connection Strings for ASP.NET Web Applications (If you use the AttachDBFileName connection string setting with SQL Server Express, see especially the User Instance section of this page.)
How to take ownership of your local SQL Server Express 2008 (SQL Server Express blog. A common problem is not being able to work with SQL Server Express databases because you're not an administrator on the SQL Server Express instance. By default, only the person who installed SQL Server Express is an administrator. This blog explains how to make yourself a SQL Server Express administrator if you're an administrator on the computer.)
SQL Databases (WindowsAzure.com site. Getting started tutorials and how-to guides.)
Getting Started with SQL Database and Entity Framework (MSDN Data Developer Center)
Transient Fault Handling Application Block A framework that enables you to handle transient network faults and connection errors that result from throttling. Available in a NuGet package: Enterprise Library 5.0 - Transient Fault Handling Application Block.
Windows Azure Training Kit (Microsoft Download Center. Includes hands-on labs for SQL Database.)
Compare SQL Server with Windows Azure SQL Database (Microsoft TechNet site)
Data Migration to Windows Azure SQL Database: Tools and Techniques (Includes sections that compare SQL Server to SQL Database and provide guidance on when to migrate from SQL Server to SQL Database.)
Windows Azure SQL Database Delivery Guide (Microsoft TechNet site)
Windows Azure Table Storage and Windows Azure SQL Database - Compared and Contrasted (For an application that you deploy to Windows Azure, Windows Azure Table storage might be an alternative to Windows Azure SQL Database. This topic helps you decide between these alternatives.)
Improving ASP.NET Performance (There is a "Retired Content" warning at the top of this page, but most of the information is still relevant and there is no comparable updated resource.)
Improving SQL Server Performance (Same comment as the previous link.)
See also Optimizing Entity Framework performance.
ASP.NET Web Forms Tutorials - Data (ASP.NET site. Most of these tutorials are relatively old; make sure you read ASP.NET Data Access Options first so that you don't get too far into a data access method that isn't right for your scenario.)
ASP.NET Web Pages Tutorials - Data (ASP.NET site)
Accessing Data in Visual Studio (Provides a list of links similar to this content map but with a focus on Visual Studio rather than ASP.NET.)