Visual Basic Guided Tour
Data Access (How Do I in Visual Basic Express)

This page provides links to Help on widely used Visual Basic data tasks. To view other categories of popular tasks covered in Help, see How Do I in Visual Basic Express.

NoteNote:

If you are using Visual Basic Express, some of the Help links on this page may be unavailable, depending on the options that you chose during installation. For more information, see Troubleshooting Visual Basic Express.

In Visual Basic Express

Visual Basic Express includes tools for adding and connecting data to your application.

Storing and Accessing Data

Provides information about how to store data with your application.

Creating Your First Database

Explains how to create a database to store data.

Getting the Information You Need: Connecting to an Existing Database

Explains how to connect your program to an existing database.

Showing Information to the User: Displaying Data in Your User Interface

Explains how to create a basic user interface for viewing the data in a local database.

Adding or Modifying Your Records: Updating Data

Explains how to create a data entry form to update data in a local database.

Displaying Related Data

Explains how to add data from a table and a related table to a Windows Forms application.

Creating LINQ to SQL Classes: Using the O/R Designer

Demonstrates how to use the O/R Designer to crate LINQ to SQL classes and then bind the data to controls on a Windows Form.

Using LINQ to Bind Data to Controls

Explains how to write a LINQ query and bind the results of the query to a control on a Windows Form.

Using LINQ in Visual Basic Express

Provides an overview of Language-Integrated Query (LINQ) and provides links to topics that describe how to use LINQ to query data.

MSDN Library for Microsoft Visual Studio 2008 Express Editions

The following are some of the more in-depth topics that the Library offers to help you as you explore adding data to your application. To use these links, you have to have the Microsoft MSDN Express Library 2008 installed or have access to the MSDN Online library.

Accessing Data in Visual Basic Applications

Visual Basic includes several new features to help you develop applications that access data.

Displaying Data Overview

Provides an overview of how to display data on a form. Also provides links to further information.

Data Sources Overview

Provides an overview of how to create and edit data sources.

TableAdapter Overview

Provides an overview of TableAdapters, which provide communication between your application and a database.

Walkthrough: Displaying Related Data on a Form in a Windows Application

Provides step-by-step details about how to display data from two related tables on a Windows Form.

Validating Data

Provides links to information about validating data.

In General

What's New in Data

Provides information and links to new data features for client data applications.

Getting Started with Data Access

Provides links to topics about how to create applications that work with data by using Visual Studio.

Creating Data Applications by Using Visual Studio

Describes the process of creating a data application in Visual Studio.

Walkthrough: Creating a Simple Data Application

Provides step-by-step instructions for creating a basic data-access application.

Data Access for Visual Basic 6.0 Users

Describes changes to data access and data tools.

Local Data Overview

Describes the features in Visual Studio for working with SQL Server Express and Access databases.

Displaying Data on Windows Forms

Displaying Data Overview

Describes the process of displaying data on Windows Forms.

Data Sources Window

Describes how to create data-bound forms by dragging items from the Data Sources window.

How to: Bind Data to Existing Controls

Describes how to bind an existing control to a specific field of data.

How to: Display Data in a Windows Forms DataGridView Control

Describes how to present data in a DataGridView on Windows Forms.

How to: Display Data in Individual Windows Forms Controls

Describes how to present data in individual controls on a Windows Forms.

How to: Display Related Data in a Windows Application

Describes how to present data from related tables in a dataset on Windows Forms.

How to: Add a Parameterized Query to a Form in a Windows Application

Describes how to modify an existing Windows Form to include controls to input parameters and execute a query.

How to: Set the Control to be Created when Dragging from the Data Sources Window

Describes how to set the control that will be created when you drag items from the Data Sources window onto a Windows Form.

How to: Add Custom Controls to the Data Sources Window

Describes how to modify the list of controls available for items in the Data Sources window, and how to add custom controls to the list.

How to: Open the Data Sources Window

Describes how to open the Data Sources window in the Visual Studio IDE.

Walkthrough: Displaying Data on a Form in a Windows Application

Provides step-by-step details about how to query data from a database and display the data on a Windows Form.

Walkthrough: Displaying Related Data on a Form in a Windows Application

Provides step-by-step details about how to display data from two related tables on a Windows Form.

Walkthrough: Creating a Form to Search Data in a Windows Application

Provides step-by-step details about how to create a Windows Form that searches for records in a database based on values provided by a user.

Walkthrough: Creating a Lookup Table

Provides step-by-step details about how to display data from one table that is based on the data selected in another table.

Walkthrough: Passing Data Between Forms in a Windows Application

Provides step-by-step details about how to pass values from one form to a second form in an application.

Walkthrough: Creating a User Control that Supports Simple Data Binding

Provides step-by-step details about how to create a custom control with attributes specific to working with Windows Forms data binding.

Connecting Applications to Data

Connecting to Data in Visual Studio Overview

Provides information about how to connect your application to data with design time tools and ADO.NET connection objects by using Visual Studio.

Data Source Configuration Wizard

Provides information about connecting to data and creating data sources by running the Data Source Configuration Wizard.

How to: Save a Connection String

Describes how to save connection information in your application.

How to: Edit a Connection String

Describes how to change existing connection information previously saved in your application.

How to: Connect to Data in an Object

Describes how to databind to property values in objects by using the Data Source Configuration Wizard.

How to: Connect to Data in a Database

Describes how to create a connection between your application and a database by using the Data Source Configuration Wizard.

How to: Connect to Data in a Web Service

Describes how to create a connection between your application and the data returned from a Web service by using the Data Source Configuration Wizard.

How to: Connect to Data in an Access Database

Describes how to create a connection between your application and an Access database by using the Data Source Configuration Wizard.

How to: Connect to Data in a SQL Server Express Database

Describes how to create a connection between your application and a SQL Express database by using the Data Source Configuration Wizard.

How to: Create Connections to SQL Server Databases

Describes how to create connection strings to SQL Server databases.

How to: Create Connections to Access Databases

Describes how to create connection strings to Access databases.

How to: Create Connections to Oracle Databases

Describes how to create connection strings to Oracle databases.

Walkthrough: Connecting to Data in a Database

Provides step-by-step details about how to create a connection between your application and a database.

Walkthrough: Connecting to Data in a SQL Server Express Database

Provides step-by-step details about how to create a connection between your application and a SQL Express database.

Walkthrough: Connecting to Data in a Web Service

Provides step-by-step details about how to create a connection between your application and a Web service.

Walkthrough: Connecting to Data in Objects

Provides step-by-step details about how to create a connection between your application and the properties of an object.

Walkthrough: Connecting to Data in an Access Database

Provides step-by-step details about how to create a connection between your application and an Access database file.

Modifying Data

How to: Add Rows to a DataTable

Provides the steps to create DataRow objects and add them to a data table.

How to: Edit Rows in a DataTable

Provides the steps for editing an existing row of data in a data table.

How to: Delete Rows in a DataTable

Provides the steps to remove specific rows of data from a data table.

How to: Turn Off Constraints While Filling a Dataset

Provides details about how to temporarily disable constraint checking in a dataset.

How to: Commit Changes in a Dataset

Provides information and details about how to accept changes that have been made to data in a dataset.

How to: Check for Changed Rows

Provides the steps to determine whether data has been changed in a dataset.

How to: Retrieve Changed Rows

Provides details about how to return rows of data that have been changed since last accepting any changes.

How to: Locate a Specific Row in a DataTable

Provides details about how to find data in a data table using either a primary key value or a column value.

How to: Get Specific Versions of a DataRow

Provides details about how to return specific rows of data by using the DataRowVersion enumeration.

How to: Locate Rows that Have Errors

Provides details about how to find data in a data table that has been marked with an error.

Updating and Saving Data

Saving Data Overview

Provides links to topics that explain how to send updated data from an application to a database.

How to: Save Dataset Changes to a Database

Provides details about how to send updated data back to a database using TableAdapters and DataAdapters.

How to: Update Data by Using a TableAdapter

Provides details about how to send updated data back to a database using TableAdapters.

How to: Insert New Records into a Database

Provides details about how to create new records in a database.

How to: Update Records in a Database

Provides details about how to send modified records back to a database.

How to: Delete Records in a Database

Provides details about how to remove records from a database.

Walkthrough: Saving Data to a Database (Single Table)

Provides step-by-step details about how to save modified data in a data table to the underlying database.

Walkthrough: Saving Data to a Database (Multiple Tables)

Provides step-by-step details about how to save modified data in two related data tables to the underlying database.

Working with TableAdapters

TableAdapter Overview

Explains what TableAdapters are and the tools available for creating them.

TableAdapter Query Configuration Wizard

Describes how to run the wizard and provides details for each wizard screen.

How to: Create TableAdapters

Provides the steps to create a new TableAdapter.

How to: Edit TableAdapters

Provides the steps for modifying existing TableAdapters.

How to: Create TableAdapter Queries

Provides the steps to add a query to an existing TableAdapter.

How to: Edit TableAdapter Queries

Provides the steps for modifying existing TableAdapter queries.

How to: View the Queries in a TableAdapter

Explains how to view the existing queries in a TableAdapter.

How to: Create Parameterized TableAdapter Queries

Provides the steps to create TableAdapter queries that accept parameters.

Walkthrough: Creating a TableAdapter with Multiple Queries

Provides step-by-step instructions for creating a TableAdapter and adding a query to it.

Loading Data

Filling Datasets and Querying Data Overview

Describes how to load data into datasets, and how to execute stored procedures and execute queries against a database.

How to: Fill a Dataset with Data

Provides details for loading data into datasets using TableAdapters and DataAdapters.

How to: Create and Execute an SQL Statement that Returns Rows

Provides details for creating and executing SQL statements that return rows by using TableAdapter queries and Command objects.

How to: Create and Execute an SQL Statement that Returns a Single Value

Provides details for creating and executing SQL statements that return single values by using TableAdapter queries and Command objects.

How to: Create and Execute an SQL Statement that Returns No Value

Provides details for creating and executing SQL statements that return no value by using TableAdapter queries and Command objects.

How to: Execute a Stored Procedure that Returns Rows

Provides details for executing stored procedures that return rows by using TableAdapter queries and Command objects.

How to: Execute a Stored Procedure that Returns a Single Value

Provides details for executing stored procedures that return single values by using TableAdapter queries and Command objects.

How to: Execute a Stored Procedure that Returns No Value

Provides details for executing stored procedures that return no value by using TableAdapter queries and Command objects.

How to: Set and Get Parameters for Command Objects

Provides details for assigning values to parameters in queries and stored procedures, and for reading values in parameters that are returned from executed commands.

Validating Data

Data Validation Overview

Provides an overview of events that can be used to analyze data before committing it to the dataset.

How to: Validate Data During Column Changes

Describes how to validate data during the ColumnChanging event.

How to: Validate Data During Row Changes

Describes how to validate data during the RowChanging event.

Walkthrough: Adding Validation to a Dataset

Provides step-by-step information about how to add validation code to a dataset.

Working with Datasets

How to: Create a Typed Dataset

Explains how to create a typed dataset by using design tools in Visual Studio.

How to: Extend the Functionality of a Dataset

Explains how and where to position code when extending the functionality of a typed dataset.

How to: Create DataTables

Provides the steps to create a new DataTable by using the Dataset Designer.

How to: Add Columns to a DataTable

Provides the steps to create a new DataColumn in an existing DataTable.

How to: Set the Data Type of a DataColumn

Explains how to set or change the data type property of a DataColumn.

How to: Change the Caption of a DataColumn

Explains how to set the caption of a DataColumn to either the column name or to something else.

How to: Set the Default Value of a DataColumn

Provides details for setting the initial value for a new DataColumn.

How to: Restrict a Data Column to Contain Unique Values

Explains how to set a DataColumn so that it cannot contain duplicate values.

How to: Set a Data Column as the Primary Key

Explains how to set a DataColumn to be the primary key in a DataTable.

How to: Create Data Columns that Display Expressions

Explains how to set a DataColumn to display a calculated value.

How to: Create DataRelations with the Dataset Designer

Explains how to use the Dataset Designer to add a DataRelation object to a dataset.

Walkthrough: Creating a DataTable in the Dataset Designer

Provides step-by-step instructions for creating a DataTable and defining the DataColumns that make up its structure.

Walkthrough: Creating a Dataset with the Dataset Designer

Provides step-by-step instructions for creating a typed dataset without the help of the Data Source Configuration Wizard.

Managing Multiple Users and Conflicts

Introduction to Data Concurrency in ADO.NET

Provides an overview of the different methods of concurrency control.

How to: Handle Concurrency Errors

Describes how to use the DBConcurrencyException object to identify concurrency exceptions and the record that caused an error.

Walkthrough: Handling a Concurrency Exception

Provides step-by-step instructions for identifying and resolving a concurrency error.

Language-Integrated Query (LINQ)

Getting Started with LINQ in Visual Basic

Provides background information about LINQ queries.

Walkthrough: Writing Queries in Visual Basic

Shows how to create queries on a list of objects, how to run the queries, and how to modify them.

Using LINQ to Objects

How to: Find the Set Difference Between Two Lists (LINQ)

Shows how to use the Except method to retrieve the items that are in one file but not in another.

Using LINQ to SQL

Getting Started (LINQ to SQL)

Provides an introduction and guide for using LINQ to SQL.

What You Can Do With LINQ to SQL

Demonstrates key database operations in LINQ to SQL: selecting, inserting, updating, and deleting.

How to: Query a Database by Using LINQ (Visual Basic)

Provides an example of how to connect to a SQL Server database and execute a query by using LINQ.

How to: Call a Stored Procedure by Using LINQ (Visual Basic)

Provides an example of how to connect to a SQL Server database and call a stored procedure by using LINQ.

How to: Modify Data in a Database by Using LINQ (Visual Basic)

Provides an example of how to connect to a SQL Server database and retrieve and modify data by using LINQ.

How to: Sort a Collection by Using LINQ (Visual Basic)

Provides an example of how to order the results of a query by using LINQ.

How to: Filter Query Results by Using LINQ (Visual Basic)

Provides an example of how to include search criteria in a query by using LINQ.

How to: Count, Sum, or Average Data by Using LINQ (Visual Basic)

Provides examples of how to include aggregate functions to Count, Sum, or Average data returned from a query by using LINQ.

How to: Find the Minimum or Maximum Value in a Query Result by Using LINQ (Visual Basic)

Provides examples of how to include aggregate functions to determine the minimum and maximum values of data returned from a query by using LINQ.

How to: Return a LINQ Query Result as a Specific Type (Visual Basic)

Provides an example of how to return the results of a LINQ query as a specific type instead of as an anonymous type.

The LINQ to SQL Object Model

Shows how an object model is mapped to the data model of a relational database.

Typical Steps for Using LINQ to SQL

Lists the steps to follow in order to implement a LINQ to SQL application, with links to supporting information at each step.

Walkthrough: Simple Object Model and Query (Visual Basic) (LINQ to SQL)

Shows how to create an entity class that models a table in a database, and how to create a simple query.

Walkthrough: Querying Across Relationships (Visual Basic) (LINQ to SQL)

Shows how to query across tables that have been mapped into a hierarchical object relationship.

Walkthrough: Manipulating Data (Visual Basic) (LINQ to SQL)

Shows how to add, update, delete and modify data in a database.

Walkthrough: Using Only Stored Procedures (Visual Basic) (LINQ to SQL)

Shows how to use stored procedures in LINQ to SQL.

How to: Display Generated SQL (LINQ to SQL)

Shows how to display and view the SQL that is generated and issued to the database by the LINQ to SQL runtime.

How to: Directly Execute SQL Queries (LINQ to SQL)

Shows how to issue raw SQL commands in place of a LINQ query.

O/R Designer Overview

Provides an introduction to using the visual design tool for creating LINQ to SQL entity classes and associations that are based on objects in a database.

How to: Add LINQ to SQL Classes to a Project (O/R Designer)

Shows how to use the Add New Item dialog box to add LINQ to SQL files to projects.

How to: Create DataContext Methods Mapped to Stored Procedures and Functions (O/R Designer)

Shows how to add stored procedures to the O/R Designer as DataContext methods.

Walkthrough: Creating LINQ to SQL Classes (O/R Designer)

Shows how to create entity classes that are based on objects in a database, and how to display the data on a Windows Form.

Using LINQ to XML

How to: Enable XML IntelliSense in Visual Basic

Shows how to add an XML schema to a Visual Basic project to provide XML IntelliSense that shows possible attributes, child elements, or descendant elements for XML literals.

How to: Create XML Literals (Visual Basic)

Shows how to create an XML element in code by using an XML literal.

How to: Embed Expressions in XML Literals

Shows how to use embedded expressions in XML literals to create content at run time.

How to: Access XML Descendant Elements (Visual Basic)

Shows how to use a descendant axis property to access all XML elements that have a specified name and that are contained under a specified XML element.

How to: Access XML Child Elements (Visual Basic)

Shows how to use a child axis property to access all XML child elements that have a specified name in an XML element.

How to: Access XML Attributes (Visual Basic)

Shows how to use an attribute axis property to access all XML attributes that have a specified name in an XML element.

How to: Declare and Use XML Namespace Prefixes

Shows how to declare an XML namespace prefix and use it to create and access XML elements.

How to: Load XML from a File, String, or Stream (Visual Basic)

Shows how to populate an XML literal from a string, file, or stream.

How to: Modify XML Literals (Visual Basic)

Shows how to modify the contents of an existing XML literal. This includes adding and removing elements and attributes and modifying element and attribute values.

How to: Transform XML by Using LINQ (Visual Basic)

Shows how to transform the contents of an XML literal into a new format.

Using LINQ to DataSet

Loading Data Into a DataSet

Describes how to load data into a dataset.

Single-Table Queries (LINQ to DataSet)

Describes how to perform queries against a single table in a dataset.

Cross-Table Queries (LINQ to DataSet)

Describes how to perform queries across multiple tables in a dataset.

Querying Typed DataSets

Describes how to perform queries against typed datasets.

LINQ to DataSet Examples

Provides many examples of how to perform various query operations, such as restriction, projection, ordering, and partitioning.

Working with Microsoft SQL Server Compact 3.5

How to: Add a SQL Server Compact 3.5 Database to a Project

Describes how to add a new or existing SQL Server Compact 3.5 database to a Windows-based application.

How to: Deploy a SQL Server Compact 3.5 Database with an Application

Describes how to configure deployment for a Windows-based application that includes a SQL Server Compact 3.5 database.

Walkthrough: Adding a SQL Server Compact 3.5 Database to an Application and Deploying it

Provides step-by-step instructions for incorporating a SQL Server Compact 3.5 database in a Windows-based application and configuring the application for deployment.

Working with Microsoft SQL Server 2005

How to: Create a SQL Server Project

Provides detailed instructions for creating a new SQL Server project.

How to: Deploy SQL Server Project Items to a SQL Server

Provides detailed instructions for deploying a SQL Server project to a database.

How to: Create and Run a CLR SQL Server Stored Procedure

Provides detailed instructions for creating a stored procedure in managed code.

Object Relational Designer (O/R Designer)

O/R Designer Overview

Explains what the O/R Designer is and provides information about the tasks you can accomplish with it.

How to: Add LINQ to SQL Classes to a Project (O/R Designer)

Describes how to add an empty LINQ to SQL file to a project.

How to: Create LINQ to SQL Classes Mapped to Tables and Views (O/R Designer)

Describes how to create entity classes that are mapped to tables and views in a database.

How to: Create DataContext Methods Mapped to Stored Procedures and Functions (O/R Designer)

Describes how to create DataContext methods that run stored procedures or functions when they are called.

How to: Assign Stored Procedures to Perform Updates, Inserts, and Deletes (O/R Designer)

Describes how to configure a DataContext method to use stored procedures when data is saved from entity classes back to a database.

How to: Turn Pluralization On and Off (O/R Designer)

Describes how to turn on and off the automatic renaming of classes that are added to the O/R Designer.

How to: Configure Inheritance by Using the O/R Designer

Describes how to use the O/R Designer to configure entity classes that use single-table inheritance.

Walkthrough: Creating LINQ to SQL Classes (O/R Designer)

Provides step-by-step instructions for designing entity classes by using the O/R Designer and for displaying data on a Windows Form.

Walkthrough: Creating LINQ to SQL Classes by Using Single-Table Inheritance (O/R Designer)

Provides step-by-step instructions for using the O/R Designer to configure entity classes that use single-table inheritance.

Other Resources

The following Web sites are excellent resources to find more information, see what other Express users are doing, and remain a part of the Visual Basic Express community as it grows.

Visual Basic Developer Center

Central location for information about Visual Basic. Includes case studies, new tools, and other downloads.

Beginner Developer Learning Center

Central location for learning materials for the beginner developer. Includes video tutorials, articles, the How-To Reference Library, and Kid's Corner.

Coding4Fun

Includes lots of articles and coding tips for the Visual Basic Express developer.

Visual Basic 6.0 Resource Center

Provides help for developers who want to upgrade Visual Basic 6.0 applications.

See Also

Concepts

Tags :


Page view tracker