Partager via


Visual Studio data tools for .NET

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Visual Studio and the .NET Framework together provide extensive API and tooling support for connecting to databases, modeling data in memory, and displaying the data in the user interface. The .NET Framework classes that provide data-access functionality are known as ADO.NET. ADO.NET, along with the data tooling in Visual Studio, was originally designed primarily to support relational databases and XML. These days, many NoSQL database vendors, or third parties, offer ADO.NET providers.

Visual Studio 2015 Update 2 includes the latest updates of SQL Server Data Tools, which enable support for the latest features in Azure SQL Database and SQL Server 2016. .NET Core supports ADO.NET, except for datasets and related types. If you are targeting .NET Core and require an object-relational mapping (ORM) layer, use Entity Framework Core.

The following diagram shows a simplified view of the basic architecture:

ADO.NET Architecture

The typical workflow is this:

  1. Install a development or test database on your local machine. See Installing database systems, tools, and samples. If you are using an Azure data service, this step is not necessary.

  2. Test the connection to the database (or service or local file) in Visual Studio. See Add new connections.

  3. (Optional) Use the tools to generate and configure a new model. Models based on Entity Framework are the default recommendation for new applications. The model, whichever one you use, is the data source that the application interacts with. The model sits logically between the database or service and the application. See Add new data sources.

  4. Drag the data source from the Data Sources window onto a Windows Forms, ASP.NET, or Windows Presentation Foundation design surface to generate the data-binding code that will display the data to the user in the way that you specify. See Bind controls to data in Visual Studio.

  5. Add custom code for things like business rules, search, and data validation, or to take advantage of custom functionality that the underlying database exposes.

    You can skip step 3 and program a .NET application to issue commands directly to a database, rather than using a model. In this case, you will find the relevant documentation here: ADO.NET. Note that you still can use the Data Source Configuration Wizard and designers to generate data-binding code when you populate your own objects in memory and then data-bind UI controls to those objects.

In this section

See Also

Accessing data in Visual Studio