Browse multiple related tables in the ADO. Net dataset (1)

Source: Internet
Author: User
Browse multiple related tables in the ADO. Net dataset (1)
Author: MicrosoftWww.aspcool.comTime: 13:48:24 views:13475

Abstract: a dataset in ADO. Net is a way to represent data in memory. It can contain multiple related data tables. This article describes how to browse these data tables in a dataset. You will create a Windows Application in Visual Basic. Net or Visual C #. net, return related records based on the selected records, and use the expression column as the relevant records to generate the total information. This article contains links to English sites.

Introduction
Since a dataset can contain several related tables, it is not obvious to understand how to browse between the parent record and the Child record, this is especially true when you try to access data in deep tables in the relevant hierarchies. You will also learn how to browse datasets that contain tables with many-to-many relationships. Each table is associated with each other through a third-party table (intermediate table.

The following is an overview of the tasks contained in this article:

Create a Windows application project.
Displays the list of data used as the initial selection.
Returns the records related to the selected record.
Browse multiple tables and multiple related structures, and directly access data in the dataset at runtime.
In addition, this article also introduces some related tasks:

Add an expression Column Based on the relevant data for the data table.
Generate the total information of related data.
Prerequisites
To fully understand this article, you should have:

Basic knowledge of relational database concepts.
A valid connection to the Rose sample database allows you to create and run applications.
Familiar with ADO. Net datasets.
Important Data Objects
To use relevant records in a dataset, you should have a basic understanding of several objects in the. NET Framework system. Data namespace and how they interact. These objects work together to provide navigation in the dataset.

The following objects are used to express the relationships in a dataset:

Dataset-Indicates data in memory. It can contain multiple able objects related to datarelation objects.
Datatable-indicates a complete data table. The architecture of a data table is defined by the datacolumncollection that makes up the table. When two data tables are related, the datarelation object uses datacolumn in each table to associate data.
Datarelation-connects multiple tables to view records in related tables. When accessing related records, the datarelation object is passed to the getchildrows or getparentrow method. The datarelation object determines the relevant table to be queried to return the relevant data associated with the call to the getchildrows or getparentrow method.
Datarow-indicates a separate record of data. The getchildrows method and getparentrow method used to return relevant data are members of the datarow object.
Datacolumn-represents a separate field. When combined, the datatable architecture is defined. When two data tables are related, the datarelation object uses the data columns in each table to associate data.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.