Skip to content

Commit 8d0e5f1

Browse files
authored
Merge pull request #10482 from ghogen/data-tools-fresh-oct22
update for VS 2022
2 parents a517404 + 13bb377 commit 8d0e5f1

9 files changed

+32
-24
lines changed

docs/data-tools/create-and-configure-datasets-in-visual-studio.md

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Create and configure datasets
33
description: Create and configure datasets in Visual Studio. A dataset is a set of objects that store data from a DB in memory and supports CRUD operations on that data.
44
ms.custom: SEO-VS-2020
5-
ms.date: 11/21/2018
5+
ms.date: 10/07/2022
66
ms.topic: how-to
77
helpviewer_keywords:
88
- typed datasets, creating
@@ -27,39 +27,47 @@ You can create a typed <xref:System.Data.DataSet> class in Visual Studio at desi
2727

2828
1. Open your project in Visual Studio, and then choose **Project** > **Add New Data Source** to start the **Data Source Configuration Wizard**.
2929

30-
2. Choose the type of data source to which you'll be connecting.
30+
1. Choose the type of data source to which you'll be connecting.
3131

32-
![Data Source Configuration Wizard](../data-tools/media/data-source-configuration-wizard.png)
32+
![Screenshot showing Data Source Configuration Wizard.](../data-tools/media/vs-2022/data-source-configuration-wizard.png)
3333

34-
3. Choose the database or databases that will be the data source for your dataset.
34+
1. Choose `DataSet` from the list of options.
3535

36-
![Data source choose a connection](../data-tools/media/data-source-choose-a-connection.png)
36+
![Screenshot showing choosing DataSet as the database model.](./media/vs-2022/data-source-configuration-wizard-2.png)
3737

38-
4. Choose the tables (or individual columns), stored procedures, functions, and views from the database that you want to be represented in the dataset.
38+
1. Choose the database or databases that will be the data source for your dataset.
3939

40-
![Choose database objects](../data-tools/media/raddata-chose-objects.png)
40+
![Screenshot showing how to choose a connection.](../data-tools/media/data-source-choose-a-connection.png)
4141

42-
5. Click **Finish**.
42+
1. Choose whether to save the connection string in *app.config*.
43+
44+
![Screenshot showing option to save connection string to the application configuration file.](./media/vs-2022/save-connection-string-to-app-config.png)
45+
46+
1. Choose the tables (or individual columns), stored procedures, functions, and views from the database that you want to be represented in the dataset.
47+
48+
![Screenshot showing how to choose your database objects.](../data-tools/media/vs-2022/choose-your-database-objects.png)
49+
50+
1. Click **Finish**.
4351

4452
The dataset appears as a node in **Solution Explorer**.
4553

46-
![DataSet in Solution Explorer](../data-tools/media/dataset-in-solution-explorer.png)
54+
![Screenshot showing DataSet in Solution Explorer.](../data-tools/media/vs-2022/dataset-in-solution-explorer.png)
4755

48-
6. Click the dataset node in **Solution Explorer** to open the dataset in the **DataSet Designer**. Each table in the dataset has an associated `TableAdapter` object, which is represented at the bottom. The table adapter is used to populate the dataset and optionally to send commands to the database.
56+
1. Click the dataset node in **Solution Explorer** to open the dataset in the **DataSet Designer**. Each table in the dataset has an associated `TableAdapter` object, which is represented at the bottom. The table adapter is used to populate the dataset and optionally to send commands to the database.
4957

50-
![DataSet Designer](../data-tools/media/dataset-designer.png)
58+
![Screenshot showing data tables in DataSet Designer.](../data-tools/media/vs-2022/dataset-in-dataset-designer.png)
5159

52-
7. The relation lines that connect the tables represent table relationships, as defined in the database. By default, foreign-key constraints in a database are represented as a relation only, with the update and delete rules set to none. Typically, that is what you want. However, you can click the lines to bring up the **Relation** dialog, where you can change the behavior of hierarchical updates. For more information, see [Relationships in datasets](../data-tools/relationships-in-datasets.md) and [Hierarchical update](../data-tools/hierarchical-update.md).
60+
1. The relation lines that connect the tables represent table relationships, as defined in the database. By default, foreign-key constraints in a database are represented as a relation only, with the update and delete rules set to none. Typically, that is what you want. However, you can click the lines to bring up the **Relation** dialog, where you can change the behavior of hierarchical updates. For more information, see [Relationships in datasets](../data-tools/relationships-in-datasets.md) and [Hierarchical update](../data-tools/hierarchical-update.md).
5361

54-
![Dataset Relation dialog](../data-tools/media/raddata-relation-dialog.png)
62+
![Dataset Relation dialog](../data-tools/media/vs-2022/dataset-relation-dialog.png)
5563

56-
8. Click a table, table adapter, or column name in a table to see its properties in the **Properties** window. You can modify some of the values here. Just remember that you are modifying the dataset, not the source database.
64+
1. Click a table, table adapter, or column name in a table to see its properties in the **Properties** window. You can modify some of the values here. Just remember that you are modifying the dataset, not the source database.
5765

58-
![DataSet column properties](../data-tools/media/dataset-column-properties.png)
66+
![Screenshot showing DataSet column properties.](../data-tools/media/vs-2022/data-column-properties.png)
5967

60-
9. You can add new tables or table adapters to the dataset, or add new queries for existing table adapters, or specify new relations between tables by dragging those items from the **Toolbox** tab. This tab appears when the **DataSet Designer** is in focus.
68+
1. You can add new tables or table adapters to the dataset, or add new queries for existing table adapters, or specify new relations between tables by dragging those items from the **Toolbox** tab. This tab appears when the **DataSet Designer** is in focus.
6169

62-
![Dataset Toolbox](../data-tools/media/raddata-dataset-toolbox.png)
70+
![Screenshot showing Dataset Toolbox.](../data-tools/media/vs-2022/dataset-designer-toolbox.png)
6371

6472
Next, you might want to specify how to populate the dataset with data. For that, you use the **TableAdapter Configuration Wizard**. For more information, see [Fill datasets by using TableAdapters](../data-tools/fill-datasets-by-using-tableadapters.md).
6573

@@ -69,23 +77,23 @@ This procedure shows how to add a table from the same database that you used to
6977

7078
1. Click the dataset node in **Solution Explorer** to bring the **DataSet Designer** into focus.
7179

72-
2. Click the **Data Sources** tab in the left margin of Visual Studio, or type **data sources** in the search box.
80+
1. Click the **Data Sources** tab in the left margin of Visual Studio, or type **data sources** in the search box.
7381

74-
3. Right-click the dataset node and select **Configure Data Source with Wizard**.
82+
1. Right-click the dataset node and select **Configure Data Source with Wizard**.
7583

76-
![Data Source context menu](../data-tools/media/data-source-context-menu.png)
84+
![Screenshot showing Data Source context menu.](../data-tools/media/vs-2022/configure-data-source-with-wizard-context-menu.png)
7785

78-
4. Use the wizard to specify which additional tables, stored procedures, or other database objects to add to the dataset.
86+
1. Use the wizard to specify which additional tables, stored procedures, or other database objects to add to the dataset.
7987

8088
## Add a stand-alone data table to a dataset
8189

8290
1. Open your dataset in the **Dataset Designer**.
8391

84-
2. Drag a <xref:System.Data.DataTable> class from the **DataSet** tab of the **Toolbox** onto the **Dataset Designer**.
92+
1. Drag a <xref:System.Data.DataTable> class from the **DataSet** tab of the **Toolbox** onto the **Dataset Designer**.
8593

86-
3. Add columns to define your data table. Right-click on the table and choose **Add** > **Column**. Use the **Properties** window to set the data type of the column and a key if necessary.
94+
1. Add columns to define your data table. Right-click on the table and choose **Add** > **Column**. Use the **Properties** window to set the data type of the column and a key if necessary.
8795

88-
Stand-alone tables need to Implement `Fill` logic in stand-alone tables so that you can fill them with data. For information on filling stand-alone data tables, see [Populating a DataSet from a DataAdapter](/dotnet/framework/data/adonet/populating-a-dataset-from-a-dataadapter).
96+
Stand-alone tables need to implement `Fill` logic so that you can fill them with data. For information on filling data tables, see [Populating a DataSet from a DataAdapter](/dotnet/framework/data/adonet/populating-a-dataset-from-a-dataadapter).
8997

9098
## See also
9199

Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)