Skip to content

Commit ab963ec

Browse files
committed
More content fixes for US 1235784.
1 parent 0387196 commit ab963ec

File tree

25 files changed

+119
-119
lines changed

25 files changed

+119
-119
lines changed

docs/data-tools/query-datasets.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ ms.workload:
1515
- "data-storage"
1616
---
1717
# Query datasets
18-
To search for specific records in a dataset, use the FindBy method on the DataTable, write your own foreach statement to loop over the table's Rows collection, or use [LINQ to DataSet](/dotnet/framework/data/adonet/linq-to-dataset).
18+
To search for specific records in a dataset, use the `FindBy` method on the DataTable, write your own foreach statement to loop over the table's Rows collection, or use [LINQ to DataSet](/dotnet/framework/data/adonet/linq-to-dataset).
1919

2020
## Dataset case sensitivity
21-
Within a dataset, table and column names are case-insensitive by default — that is, a table in a dataset called "Customers" can also be referred to as "customers." This matches the naming conventions in many databases, including SQL Server. In SQL Server, the default behavior is that the names of data elements cannot be distinguished only by case.
21+
Within a dataset, table and column names are case-insensitive by default — that is, a table in a dataset called "Customers" can also be referred to as "customers." This matches the naming conventions in many databases, including SQL Server. In SQL Server, the default behavior is that the names of data elements cannot be distinguished only by case.
2222

2323
> [!NOTE]
2424
> Unlike datasets, XML documents are case-sensitive, so the names of data elements defined in schemas are case-sensitive. For example, schema protocol allows the schema to define a table called "Customers" and a different table called "customers." This can result in name collisions when a schema that contains elements that differ only by case is used to generate a dataset class.
@@ -59,7 +59,7 @@ Case sensitivity, however, can be a factor in how data is interpreted within the
5959
## Access related records
6060
When tables in a dataset are related, a <xref:System.Data.DataRelation> object can make the related records available in another table. For example, a dataset containing `Customers` and `Orders` tables can be made available.
6161

62-
You can use a <xref:System.Data.DataRelation> object to locate related records by calling the <xref:System.Data.DataRow.GetChildRows%2A> method of a <xref:System.Data.DataRow> in the parent table. This method returns an array of related child records. Or you can call the <xref:System.Data.DataRow.GetParentRow%2A> method of a <xref:System.Data.DataRow> in the child table. This method returns a single <xref:System.Data.DataRow> from the parent table.
62+
You can use a <xref:System.Data.DataRelation> object to locate related records by calling the <xref:System.Data.DataRow.GetChildRows%2A> method of a <xref:System.Data.DataRow> in the parent table. This method returns an array of related child records. Or, you can call the <xref:System.Data.DataRow.GetParentRow%2A> method of a <xref:System.Data.DataRow> in the child table. This method returns a single <xref:System.Data.DataRow> from the parent table.
6363

6464
This page provides examples using typed datasets. For information about navigating relationships in untyped datasets, see [Navigating DataRelations](/dotnet/framework/data/adonet/dataset-datatable-dataview/navigating-datarelations).
6565

docs/data-tools/read-xml-data-into-a-dataset.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ In this step, you create a new dataset named `authors`. For more information abo
161161

162162
1. In **Solution Explorer**, select the source file for **Form1**, and then select the **View Designer** button on the **Solution Explorer** toolbar.
163163

164-
2. From the [Toolbox, Data Tab](../ide/reference/toolbox-data-tab.md), drag a **DataSet** onto **Form1**.
164+
2. From the [Toolbox, Data tab](../ide/reference/toolbox-data-tab.md), drag a **DataSet** onto **Form1**.
165165

166166
3. In the **Add Dataset** dialog box, select **Untyped dataset**, and then select **OK**.
167167

docs/data-tools/relationships-in-datasets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The rules that you can make are specified in the <xref:System.Data.Rule> enumera
5454
|Foreign-key constraint rule|Action|
5555
|----------------------------------|------------|
5656
|<xref:System.Data.Rule.Cascade>|The change (update or delete) made to the parent record is also made in related records in the child table.|
57-
|<xref:System.Data.Rule.SetNull>|Child records are not deleted, but the foreign key in the child records is set to <xref:System.DBNull>. With this setting, child records can be left as "orphans"—that is, they have no relationship to parent records. **Note:** Using this rule can result in invalid data in the child table.|
57+
|<xref:System.Data.Rule.SetNull>|Child records are not deleted, but the foreign key in the child records is set to <xref:System.DBNull>. With this setting, child records can be left as "orphans"—that is, they have no relationship to parent records. **Note:** Using this rule can result in invalid data in the child table.|
5858
|<xref:System.Data.Rule.SetDefault>|The foreign key in the related child records is set to its default value (as established by the column's <xref:System.Data.DataColumn.DefaultValue%2A> property).|
5959
|<xref:System.Data.Rule.None>|No change is made to related child records. With this setting, child records can contain references to invalid parent records.|
6060

docs/data-tools/save-a-dataset-as-xml.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ ms.workload:
2121
---
2222
# Save a dataset as XML
2323

24-
The XML data in a dataset can be accessed by calling the available XML methods on the dataset. To save the data in XML format, you can call either the <xref:System.Data.DataSet.GetXml%2A> method or the <xref:System.Data.DataSet.WriteXml%2A> method of a <xref:System.Data.DataSet>.
24+
Access the XML data in a dataset by calling the available XML methods on the dataset. To save the data in XML format, you can call either the <xref:System.Data.DataSet.GetXml%2A> method or the <xref:System.Data.DataSet.WriteXml%2A> method of a <xref:System.Data.DataSet>.
2525

2626
Calling the <xref:System.Data.DataSet.GetXml%2A> method returns a string that contains the data from all data tables in the dataset that's formatted as XML.
2727

28-
Calling the <xref:System.Data.DataSet.WriteXml%2A> method sends the XML-formatted data to a file that you specify.
28+
Calling the <xref:System.Data.DataSet.WriteXml%2A> method sends the XML-formatted data to a file that you specify.
2929

3030
## To save the data in a dataset as XML to a variable
3131

docs/data-tools/save-data-back-to-the-database.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ ms.workload:
2727

2828
The dataset is an in-memory copy of data. If you modify that data, it's a good practice to save those changes back to the database. You do this in one of three ways:
2929

30-
- By calling one of the Update methods of a TableAdapter
30+
- By calling one of the `Update` methods of a TableAdapter
3131

32-
- By calling one of DBDirect methods of the TableAdapter
32+
- By calling one of `DBDirect` methods of the TableAdapter
3333

34-
- By calling the UpdateAll method on the TableAdapterManager that Visual Studio generates for you when the dataset contains tables that are related to other tables in the dataset
34+
- By calling the `UpdateAll` method on the TableAdapterManager that Visual Studio generates for you when the dataset contains tables that are related to other tables in the dataset
3535

3636
When you data bind dataset tables to controls on a Windows Form or XAML page, the data binding architecture does all the work for you.
3737

@@ -43,7 +43,7 @@ If you're familiar with TableAdapters, you can jump directly to one of these top
4343
|[Update data by using a TableAdapter](../data-tools/update-data-by-using-a-tableadapter.md)|How to perform updates with TableAdapters|
4444
|[Hierarchical update](../data-tools/hierarchical-update.md)|How to perform updates from a dataset with two or more related tables|
4545
|[Handle a concurrency exception](../data-tools/handle-a-concurrency-exception.md)|How to handle exceptions when two users attempt to change the same data in a database at the same time|
46-
|[How to: Save data by using a transaction](../data-tools/save-data-by-using-a-transaction.md)|How to save data in a transaction using the System.Transactions namespace and a TransactionScope object|
46+
|[How to: Save data by using a transaction](../data-tools/save-data-by-using-a-transaction.md)|How to save data in a transaction using the System. Transactions namespace and a TransactionScope object|
4747
|[Save data in a transaction](../data-tools/save-data-in-a-transaction.md)|Walkthrough that creates a Windows Forms application to demonstrate saving data to a database inside a transaction|
4848
|[Save data to a database (multiple tables)](../data-tools/save-data-to-a-database-multiple-tables.md)|How to edit records and save changes in multiple tables back to the database|
4949
|[Save data from an object to a database](../data-tools/save-data-from-an-object-to-a-database.md)|How to pass data from an object that is not in a dataset to a database by using a TableAdapter DbDirect method|
@@ -52,13 +52,13 @@ If you're familiar with TableAdapters, you can jump directly to one of these top
5252

5353
## Two-stage updates
5454

55-
Updating a data source is a two-step process. The first step is to update the dataset with new records, changed records, or deleted records. If your application never sends those changes back to the data source, then you are finished with the update.
55+
Updating a data source is a two-step process. The first step is to update the dataset with new records, changed records, or deleted records. If your application never sends those changes back to the data source, then you're finished with the update.
5656

57-
If you do send the changes back to the database, then a second step is required. If you aren't using data-bound controls, then you have to manually call the Update method of the same TableAdapter (or data adapter) that you used to populate the dataset. However, you can also use different adapters, for example, to move data from one data source to another or to update multiple data sources. If you aren't using data binding, and are saving changes for related tables, you have to manually instantiate a variable of the auto-generated TableAdapterManager class, and then call its UpdateAll method.
57+
If you do send the changes back to the database, a second step is required. If you aren't using data-bound controls, you have to manually call the `Update` method of the same TableAdapter (or data adapter) that you used to populate the dataset. However, you can also use different adapters, for example, to move data from one data source to another or to update multiple data sources. If you aren't using data binding, and are saving changes for related tables, you have to manually instantiate a variable of the auto-generated `TableAdapterManager` class, and then call its `UpdateAll` method.
5858

5959
![Conceptual diagram of dataset updates](../data-tools/media/vbdatasetupdates.gif)
6060

61-
A dataset contains collections of tables, which contain a collections of rows. If you intend to update an underlying data source later, you must use the methods on the DataTable.DataRowCollection property when adding or removing rows. Those methods perform the change tracking that's needed for updating the data source. If you call the RemoveAt collection on the Rows property, the deletion won't be communicated back to the database.
61+
A dataset contains collections of tables, which contain a collections of rows. If you intend to update an underlying data source later, you must use the methods on the `DataTable.DataRowCollection` property when adding or removing rows. Those methods perform the change tracking that's needed for updating the data source. If you call the `RemoveAt` collection on the Rows property, the deletion won't be communicated back to the database.
6262

6363
## Merge datasets
6464

@@ -109,7 +109,7 @@ For more information about suspending events, see [Turn off constraints while fi
109109

110110
## Dataset update errors
111111

112-
When you update a record in a dataset, there is the possibility of an error. For example, you might inadvertently write data of the wrong type to a column, or data that's too long, or data that has some other integrity problem. Or you might have application-specific validation checks that can raise custom errors during any stage of an update event. For more information, see [Validate data in datasets](../data-tools/validate-data-in-datasets.md).
112+
When you update a record in a dataset, there is the possibility of an error. For example, you might inadvertently write data of the wrong type to a column, or data that's too long, or data that has some other integrity problem. Or, you might have application-specific validation checks that can raise custom errors during any stage of an update event. For more information, see [Validate data in datasets](../data-tools/validate-data-in-datasets.md).
113113

114114
## Maintain information about changes
115115

@@ -131,7 +131,7 @@ The following table details the possible values of the <xref:System.Data.DataRow
131131

132132
### DataRowVersion enumeration
133133

134-
Datasets maintain multiple versions of records. The <xref:System.Data.DataRowVersion> fields can be used when retrieving the value found in a <xref:System.Data.DataRow> using the <xref:System.Data.DataRow.Item%2A> property or the <xref:System.Data.DataRow.GetChildRows%2A> method of the <xref:System.Data.DataRow> object.
134+
Datasets maintain multiple versions of records. The <xref:System.Data.DataRowVersion> fields are used when retrieving the value found in a <xref:System.Data.DataRow> using the <xref:System.Data.DataRow.Item%2A> property or the <xref:System.Data.DataRow.GetChildRows%2A> method of the <xref:System.Data.DataRow> object.
135135

136136
The following table details the possible values of the <xref:System.Data.DataRowVersion> enumeration:
137137

@@ -215,7 +215,7 @@ You can validate data in several ways:
215215

216216
- In the business layer, by adding code to your application to validate data. The dataset is one place you can do this. The dataset provides some of the advantages of back-end validation — such as the ability to validate changes as column and row values are changing. For more information, see [Validate data in datasets](../data-tools/validate-data-in-datasets.md).
217217

218-
- In the presentation layer, by adding validation to forms. For more information, see [User Input Validation in Windows Forms](/dotnet/framework/winforms/user-input-validation-in-windows-forms).
218+
- In the presentation layer, by adding validation to forms. For more information, see [User input validation in Windows Forms](/dotnet/framework/winforms/user-input-validation-in-windows-forms).
219219

220220
- In the data back end, by sending data to the data source — for example, the database — and allowing it to accept or reject the data. If you are working with a database that has sophisticated facilities for validating data and providing error information, this can be a practical approach because you can validate the data no matter where it comes from. However, this approach might not accommodate application-specific validation requirements. Additionally, having the data source validate data can result in numerous round trips to the data source, depending on how your application facilitates the resolution of validation errors raised by the back end.
221221

@@ -244,7 +244,7 @@ Your application changes Nancy Buchanan's status to "Preferred." As a result of
244244

245245
Your application now calls the `Update` method to transmit the dataset to the database. The method inspects each row in turn. For the first row, the method transmits no SQL statement to the database because that row has not changed since it was originally fetched from the database.
246246

247-
For the second row, however, the `Update` method automatically invokes the correct data command and transmits it to the database. The specific syntax of the SQL statement depends on the dialect of SQL that's supported by the underlying data store. But the following general traits of the transmitted SQL statement are noteworthy:
247+
For the second row, however, the `Update` method automatically invokes the correct data command and transmits it to the database. The specific syntax of the SQL statement depends on the dialect of SQL that's supported by the underlying data store. But, the following general traits of the transmitted SQL statement are noteworthy:
248248

249249
- The transmitted SQL statement is an UPDATE statement. The adapter knows to use an UPDATE statement because the value of the <xref:System.Data.DataRow.RowState%2A> property is <xref:System.Data.DataRowState.Modified>.
250250

@@ -263,15 +263,15 @@ If you've used the Visual Studio tools to generate a data adapter, the `UpdateCo
263263

264264
The <xref:System.Data.SqlClient.SqlParameter.SourceColumn%2A?displayProperty=fullName> property of each parameter points to a column in the data table. For example, the `SourceColumn` property for the `au_id` and `Original_au_id` parameters is set to whatever column in the data table contains the author id. When the adapter's `Update` method runs, it reads the author id column from the record that's being updated and fills the values into the statement.
265265

266-
In an UPDATE statement, you need to specify both the new values (those that will be written to the record) as well as the old values (so that the record can be located in the database). There are therefore two parameters for each value: one for the SET clause and a different one for the WHERE clause. Both parameters read data from the record that's being updated, but they get different versions of the column value based on the parameter's <xref:System.Data.SqlClient.SqlParameter.SourceVersion> property. The parameter for the SET clause gets the current version, and the parameter for the WHERE clause gets the original version.
266+
In an UPDATE statement, you need to specify both the new values (those that will be written to the record) as well as the old values (so that the record can be located in the database). There are, therefore, two parameters for each value: one for the SET clause and a different one for the WHERE clause. Both parameters read data from the record that's being updated, but they get different versions of the column value based on the parameter's <xref:System.Data.SqlClient.SqlParameter.SourceVersion> property. The parameter for the SET clause gets the current version, and the parameter for the WHERE clause gets the original version.
267267

268268
> [!NOTE]
269269
> You can also set values in the `Parameters` collection yourself in code, which you would typically do in an event handler for the data adapter's <xref:System.Data.DataTable.RowChanging> event.
270270
271271
## See also
272272

273273
- [Dataset tools in Visual Studio](../data-tools/dataset-tools-in-visual-studio.md)
274-
- [Create and Configure TableAdapters](create-and-configure-tableadapters.md)
274+
- [Create and configure TableAdapters](create-and-configure-tableadapters.md)
275275
- [Update data by using a TableAdapter](../data-tools/update-data-by-using-a-tableadapter.md)
276276
- [Bind controls to data in Visual Studio](../data-tools/bind-controls-to-data-in-visual-studio.md)
277277
- [Validate data](validate-data-in-datasets.md)

0 commit comments

Comments
 (0)