Data Access (How Do I in C#)
This topic links to help about widely used data access tasks that use ADO.NET types directly in your application. For more information about how to access data by using LINQ to SQL or LINQ to DataSet, see LINQ (How Do I in C#).
To view other categories of popular tasks covered in Help, see How Do I in C#.
General
How to: Install Sample Databases
Provides steps to install a sample database.Walkthrough: Creating a Simple Data Application
Provides a step-by-step procedure to create a data application.
Connecting to Data in Visual Studio
Connecting to Data in Visual Studio Overview
Provides information about how to connect your application to data from many different sources, such as databases, Web services, and objects.Walkthrough: Connecting to Data in a Database
Provides a procedure to connect your application to data in Visual Studio by using the Data Source Configuration Wizard.Walkthrough: Connecting to Data in a Web Service
Provides a procedure to connect your application to data in a Web service by using the Data Source Configuration Wizard.Walkthrough: Connecting to Data in an Access Database
Provides a procedure to connect your application to data in an Access database by using the Data Source Configuration Wizard.
Creating and Designing Typed Datasets
How to: Create a Typed Dataset
Explains how to create a typed DataSet by using the Data Source Configuration Wizard or the Dataset Designer.Walkthrough: Creating a Dataset with the Dataset Designer
Provides a procedure to create a dataset using the Dataset Designer.Walkthrough: Creating a DataTable in the Dataset Designer
Provides a procedure to create a DataTable by using the Dataset Designer.Walkthrough: Creating a Relationship between Data Tables
Explains how to create two data tables without TableAdapters by using the Dataset Designer and how to create a relationship between them.
TableAdapters
TableAdapter Overview
Provides an overview of TableAdapters which provides communication between your application and a database.Walkthrough: Creating a TableAdapter with Multiple Queries
Provides a procedure to create a TableAdapter in a dataset by using the Data Source Configuration Wizard. The walkthrough shows how to create a second query in the TableAdapter by using the TableAdapter Query Configuration Wizard in the Dataset Designer.
Filling Datasets and Executing Queries
Filling Datasets and Querying Data Overview
Explains how to execute SQL statements or stored procedures against a data source by using TableAdapters or command objects.Walkthrough: Filling a Dataset with Data
Demonstrates how to create a dataset with one data table and fill it with data from the Customers table in the Northwind sample database.Walkthrough: Reading XML Data into a Dataset
Demonstrates how to create a Windows application that will load XML data into a dataset.
Displaying Data on Windows Forms
Displaying Data Overview
Provides a summary of the tasks, objects, and dialog boxes involved in creating data-bound Windows applications.Walkthrough: Displaying Data on a Form in a Windows Application
Provides a procedure to create a simple form that displays data from a single table in several individual controls.Walkthrough: Displaying Related Data on a Form in a Windows Application
Provides a procedure to work with data that comes from more than one table, and often, data from related tables.Walkthrough: Creating a Form to Search Data in a Windows Application
Shows how to create a query that returns customers in a specific city, and modify the user interface so that users can enter a city's name and press a button to execute the query.Walkthrough: Creating a Lookup Table
Provides a procedure to display information from one table that is based on the value of a foreign-key field in another table.
Databinding
Walkthrough: Creating a User Control that Supports Simple Data Binding
Shows how to create a control that implements the DefaultBindingPropertyAttribute. This control can contain one property that can be bound to data; similar to a TextBox, or CheckBox.Walkthrough: Creating a User Control that Supports Complex Data Binding
Shows how to create a control that implements the ComplexBindingPropertiesAttribute. This control contains a DataSource and DataMember property that can be bound to data, similar to a DataGridView, or ListBox.Walkthrough: Creating a User Control that Supports Lookup Databinding
Shows how to create a control that implements the LookupBindingPropertiesAttribute. This control contains three properties that can be bound to data, similar to a ComboBox.Object Binding in Visual Studio
Explains design-time tools for working with custom objects (instead of datasets and Web services) as the data source in your application.
Editing Data in Datasets (DataTables)
- Editing Data in Datasets Overview
Provides a table that contains links to the common tasks associated with editing and querying data in a dataset.
Validating Data
Data Validation Overview
Provides an overview of validating data, the process of confirming that the values being entered into data objects conform to the constraints in a dataset's schema and the rules established for your application.Walkthrough: Adding Validation to a Dataset
Explains how to use the ColumnChanging event to verify that an acceptable value is being entered into the record.
Saving Data
Saving Data Overview
Explains how writing information to the original data source is separate from modifying the data in the dataset.Concurrency Control in ADO.NET
Explains common methods of concurrency control and specific ADO.NET features for handling concurrency errors.Walkthrough: Saving Data with the TableAdapter DBDirect Methods
Provides detailed instructions to execute SQL statements directly against a database using the DbDirect methods of a TableAdapter.Walkthrough: Handling a Concurrency Exception
Contains a procedure to create a Windows application that illustrates catching a DBConcurrencyException, locating the row that caused the error, and one strategy for handling it.
Data Resources
Data User Interface Elements
Contains information about all the dialog boxes and wizards that you use when you design data access in your applications.ADO.NET Data Adapters
Provides information about ADO.NET data-adapter objects and how to work with them in Visual Studio.
Creating SQL Server 2005 Objects in Managed Code
SQL Server Projects
Explains how to use .NET languages and the Transact-SQL programming language to create database objects such as stored procedures and triggers, and to retrieve and update data for Microsoft SQL Server 2005 databases.Walkthrough: Creating a Stored Procedure in Managed Code
Provides step by step instructions for the following procedures:Creating a stored procedure in managed code.
Deploying the stored procedure to a SQL Server 2005 database.
Create a script to test the stored procedure on the database.
Query data in the database to confirm the stored procedure executed correctly.
Additional Resources
The following sites require an Internet connection.
Visual Studio 2008 Developer Center
Contains many articles and resources about how to develop applications by using Visual Studio. This site is updated regularly with new content.Visual C# Developer Center
Contains many articles and resources about how to develop C# applications. This site is updated regularly with new content.Microsoft .NET Framework Developer Center
Contains many articles and resources about how to develop and debugging .NET Framework applications. This site is updated regularly with new content.Data Access and Storage Developer Center
Contains many articles and resources about how to use Microsoft data access technologies in your applications.SQL Server Developer Center
Contains many articles and resources about how to use SQL Server.