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.
Data Storage Options (Building Real-World Cloud Apps with Windows Azure). Chapter of an e-book about developing for the cloud. Introduces NoSQL databases as an alternative that many developers familiar with relational databases tend to overlook. Presents guidelines on what to think about when choosing relational or NoSQL, or choosing a particular platform.
ASP.NET Data Access Options (MSDN). An introduction to data access options for relational databases for ASP.NET and guidance on how to choose platforms and access methods that are appropriate for your scenario.
Relational database. Wikipedia). 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.
Using the Entity Framework
Entity Framework Development Approaches (MSDN). Guidance on how to choose an Entity Framework development approach Database First, Model First, or Code First.
Using Entity Framework Code First
The following tutorials offer downloadable sample applications:
Getting Started with EF 6 using MVC 5. Covers a wide range of Entity Framework Code First scenarios, including Migrations and EF 6 features such as connection resiliency, command interception, and async. This is an updated version of the EF 5 / MVC 4 series. The earlier series includes a tutorial on the repository and unit-of-work patterns that is not included in the new series.
Introduction to ASP.NET MVC 5. Covers a narrower range of Entity Framework Code First scenarios but does a more comprehensive job of introducing MVC features.
MVC Music Store. Uses Code First in an e-commerce MVC 3 application that also implements membership and authorization. The MVC version and ASP.NET membership (authentication and authorization) system used here are outdated; for more up-to-date information on ASP.NET membership, see https://asp.net/identity.
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.
Code First Migrations With ASP.NET Web Pages Sites. Mikesdotnetting blog). Shows how to use Code First migrations with an ASP.NET Web Pages site by putting the data context in a Visual Studio class library project.
Using Entity Framework Database First or Model First (the EF Designer)
Getting Started with Entity Framework 6 Database First using MVC 5. Run a script in Server Explorer to create a database, and then use the Entity Framework designer to create the data model. Shows how to create simple CRUD web pages, and for other data handling functions you can follow one of the Code First tutorials since all EF workflows use the same DbContext API.
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.
Continuing with the Entity Framework(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.
Handling related data in Entity Framework (Lazy Loading, Eager Loading, and Explicit Loading)
Both of these books are up-to-date with current recommended techniques. They provide a 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. See also the list of books recommended by the Entity Framework team at Data Developer Center - Books on the MSDN site.
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.
Installing Sample Databases. 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 How to: Upgrade to LocalDB.
See also the following sections on working with SQL Server Express and LocalDB, and choosing between SQL Server and SQL Database.
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.
Moving to Windows Azure SQL Database (MSDN). One chapter of a comprehensive end-to-end scenario by the Microsoft Patterns and Practices team. Covers why you might want to migrate and how to migrate from SQL Server to SQL Database.
Improving ASP.NET Performance (MSDN). 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.