Skip to content

Commit 1a6ce01

Browse files
author
Kraig Brockschmidt
committed
Merge branch 'kraigb-rtvs' of https://github.com/MicrosoftDocs/visualstudio-docs-pr into kraigb-rtvs
2 parents e3f2aea + 7b22553 commit 1a6ce01

11 files changed

+50
-49
lines changed

docs/data-tools/accessing-data-in-visual-studio.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ In Visual Studio, you can create applications that connect to data in virtually
8181

8282
For data-access documentation specifically related to ASP.NET, see [Working with Data](http://www.asp.net/web-forms/overview/presenting-and-managing-data) on the ASP.NET site. For a tutorial on using Entity Framework with ASP.NET MVC, see [Getting Started with Entity Framework 6 Code First using MVC 5](http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application).
8383

84-
Universal Windows Platform (UWP) apps in C# or Visual Basic can use the Microsoft Azure SDK for .NET to access Azure Storage and other Azure services. The Windows.Web.HttpClient class enables communication with any RESTful service. For more information, see [How to connect to an HTTP server using Windows.Web.Http](https://msdn.microsoft.com/library/windows/apps/dn469430.aspx.)
84+
Universal Windows Platform (UWP) apps in C# or Visual Basic can use the Microsoft Azure SDK for .NET to access Azure Storage and other Azure services. The Windows.Web.HttpClient class enables communication with any RESTful service. For more information, see [How to connect to an HTTP server using Windows.Web.Http](https://msdn.microsoft.com/library/windows/apps/dn469430.aspx).
8585

8686
For data storage on the local machine, the recommended approach is to use SQLite, which runs in the same process as the app. If an object-relational mapping (ORM) layer is required, you can use Entity Framework. For more information, see [Data access](https://msdn.microsoft.com/windows/uwp/data-access/index) in the Windows Developer Center.
8787

docs/data-tools/create-and-configure-tableadapters.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ The **Advanced Options** in the wizard enable you to:
7878

7979
Any changes that you make to the TableAdapter's main `Fill` method are reflected in the schema of the associated data table. For example, removing a column from the query in the main `Fill` method also removes the column from the associated data table. Additionally, removing the column from the main `Fill` method removes the column from any additional queries for that TableAdapter.
8080

81-
You can use the TableAdapter Query Configuration Wizard to create and edit additional queries for the TableAdapter. These additional queries must conform to the table schema, unless they return a scalar value. The additional queries have a names that you specify (for example, `CustomersTableAdapter.FillByCity(NorthwindDataSet.Customers, "Seattle")`.)
81+
You can use the TableAdapter Query Configuration Wizard to create and edit additional queries for the TableAdapter. These additional queries must conform to the table schema, unless they return a scalar value. Each additional query has a name that you specify.
82+
83+
The following example shows you how to call an additional query named `FillByCity`:
84+
85+
`CustomersTableAdapter.FillByCity(NorthwindDataSet.Customers, "Seattle")`
8286

8387
#### To start the TableAdapter Query Configuration Wizard with a new query
8488

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ You edit data in data tables much like you edit the data in a table in any datab
8282

8383
Changes are tracked two ways in each data row:
8484

85-
- Each data row contains information related to it's <xref:System.Data.DataRow.RowState%2A> (for example, <xref:System.Data.DataRowState>, <xref:System.Data.DataRowState>, <xref:System.Data.DataRowState>, or <xref:System.Data.DataRowState>).
85+
- Each data row contains information related to its <xref:System.Data.DataRow.RowState%2A> (for example, <xref:System.Data.DataRowState>, <xref:System.Data.DataRowState>, <xref:System.Data.DataRowState>, or <xref:System.Data.DataRowState>).
8686

87-
- Each changed data row contains multiple versions of that row (<xref:System.Data.DataRowVersion>), the original version (before changes), and the current version (after changes). During the period when a change is pending (the time when you can respond to the <xref:System.Data.DataTable.RowChanging> event), a third version — the proposed version— is available as well.
87+
- Each changed data row contains multiple versions of that row (<xref:System.Data.DataRowVersion>), the original version (before changes) and the current version (after changes). During the period when a change is pending (the time when you can respond to the <xref:System.Data.DataTable.RowChanging> event), a third version — the proposed version— is available as well.
8888

8989
The <xref:System.Data.DataSet.HasChanges%2A> method of a dataset returns `true` if changes have been made in the dataset. After determining that changed rows exist, you can call the `GetChanges` method of a <xref:System.Data.DataSet> or <xref:System.Data.DataTable> to return a set of changed rows.
9090

docs/data-tools/handle-a-concurrency-exception.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Concurrency exceptions (<xref:System.Data.DBConcurrencyException>) are raised wh
138138

139139
- The proposed changes in the dataset
140140

141-
The user is then able to either overwrite the database with the proposed version, or cancel the update and refresh the dataset with the new values from the database.
141+
The user is then able to either overwrite the database with the proposed version, or cancel the update and refresh the dataset with the new values from the database.
142142

143143
#### To enable the handling of concurrency errors
144144

@@ -153,7 +153,7 @@ Concurrency exceptions (<xref:System.Data.DBConcurrencyException>) are raised wh
153153
### Add code to handle the concurrency exception
154154
When you attempt to perform an update and an exception gets raised, you generally want to do something with the information that's provided by the raised exception.
155155

156-
In this section, you add code that attempts to update the database.You also handle any <xref:System.Data.DBConcurrencyException> that might get raised, as well as any other exceptions.
156+
In this section, you add code that attempts to update the database. You also handle any <xref:System.Data.DBConcurrencyException> that might get raised, as well as any other exceptions.
157157

158158
> [!NOTE]
159159
> The `CreateMessage` and `ProcessDialogResults` methods will be added later in this walkthrough.
@@ -171,7 +171,7 @@ Concurrency exceptions (<xref:System.Data.DBConcurrencyException>) are raised wh
171171
[!code-vb[VbRaddataConcurrency#2](../data-tools/codesnippet/VisualBasic/handle-a-concurrency-exception_2.vb)]
172172

173173
### Display choices to the user
174-
The code you just wrote calls the `CreateMessage` procedure to display error information to the user. For this walkthrough, you use a message box to display the different versions of the record to the user.This enables the user to choose whether to overwrite the record with the changes or cancel the edit. Once the user selects an option (clicks a button) on the message box, the response is passed to the `ProcessDialogResult` method.
174+
The code you just wrote calls the `CreateMessage` procedure to display error information to the user. For this walkthrough, you use a message box to display the different versions of the record to the user. This enables the user to choose whether to overwrite the record with the changes or cancel the edit. Once the user selects an option (clicks a button) on the message box, the response is passed to the `ProcessDialogResult` method.
175175

176176
##### To create the message to display to the user
177177

docs/data-tools/hierarchical-update.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ translation.priority.mt:
9999
[!code-vb[VSProDataOrcasHierarchicalUpdate#1](../data-tools/codesnippet/VisualBasic/hierarchical-update_1.vb)]
100100
[!code-csharp[VSProDataOrcasHierarchicalUpdate#1](../data-tools/codesnippet/CSharp/hierarchical-update_1.cs)]
101101

102-
In addition to committing changes on a related child table before saving data to a database, you might also have to commit newly created parent records before adding new child records to a dataset. In other words, you might have to add the new parent record (Customer) to the dataset before foreign key constraints enable new child records (Orders) to be added to the dataset. To accomplish this, you can use the child `BindingSource.AddingNew` event.
102+
In addition to committing changes on a related child table before saving data to a database, you might also have to commit newly created parent records before adding new child records to a dataset. In other words, you might have to add the new parent record (Customer) to the dataset before foreign key constraints enable new child records (Orders) to be added to the dataset. To accomplish this, you can use the child `BindingSource.AddingNew` event.
103103

104104
> [!NOTE]
105105
> Whether you have to commit new parent records depends on the type of control that's used to bind to your data source. In this walkthrough, you use individual controls to bind to the parent table. This requires the additional code to commit the new parent record. If the parent records were instead displayed in a complex binding control like the <xref:System.Windows.Forms.DataGridView>, this additional <xref:System.Windows.Forms.BindingSource.EndEdit%2A> call for the parent record would not be necessary. This is because the underlying data-binding functionality of the control handles the committing of the new records.

docs/data-tools/insert-new-records-into-a-database.md

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,36 +58,35 @@ To insert new records into a database, you can use the `TableAdapter.Update` met
5858

5959
2. After the new rows are added to the <xref:System.Data.DataTable>, call the `TableAdapter.Update` method. You can control the amount of data to update by passing in either an entire <xref:System.Data.DataSet>, a <xref:System.Data.DataTable>, an array of <xref:System.Data.DataRow>s, or a single <xref:System.Data.DataRow>.
6060

61-
The following code shows how to add a new record to a <xref:System.Data.DataTable> and then call the `TableAdapter.Update` method to save the new row to the database. (This example uses the `Region` table in the Northwind database.)
61+
The following code shows how to add a new record to a <xref:System.Data.DataTable> and then call the `TableAdapter.Update` method to save the new row to the database. (This example uses the `Region` table in the Northwind database.)
6262

63-
[!code-vb[VbRaddataSaving#14](../data-tools/codesnippet/VisualBasic/insert-new-records-into-a-database_1.vb)]
64-
[!code-csharp[VbRaddataSaving#14](../data-tools/codesnippet/CSharp/insert-new-records-into-a-database_1.cs)]
65-
66-
If your application uses objects to store data, you can use the `TableAdapter.Insert` method to create new rows directly in the database. The `Insert` method accepts the individual values for each column as parameters. Calling the method inserts a new record into the database with the parameter values passed in.
67-
68-
The following procedure uses the `Region` table in the Northwind database as an example.
63+
[!code-vb[VbRaddataSaving#14](../data-tools/codesnippet/VisualBasic/insert-new-records-into-a-database_1.vb)]
64+
[!code-csharp[VbRaddataSaving#14](../data-tools/codesnippet/CSharp/insert-new-records-into-a-database_1.cs)]
6965

7066
#### To insert new records into a database by using the TableAdapter.Insert method
67+
If your application uses objects to store data, you can use the `TableAdapter.Insert` method to create new rows directly in the database. The `Insert` method accepts the individual values for each column as parameters. Calling the method inserts a new record into the database with the parameter values passed in.
7168

72-
- Call the TableAdapter's `Insert` method, passing in the values for each column as parameters.
69+
- Call the TableAdapter's `Insert` method, passing in the values for each column as parameters.
70+
71+
The following procedure demonstrates using the `TableAdapter.Insert` method to insert rows. This example inserts data into the `Region` table in the Northwind database.
7372

74-
> [!NOTE]
75-
> If you do not have an instance available, instantiate the TableAdapter you want to use.
73+
> [!NOTE]
74+
> If you do not have an instance available, instantiate the TableAdapter you want to use.
7675
77-
[!code-vb[VbRaddataSaving#15](../data-tools/codesnippet/VisualBasic/insert-new-records-into-a-database_2.vb)]
78-
[!code-csharp[VbRaddataSaving#15](../data-tools/codesnippet/CSharp/insert-new-records-into-a-database_2.cs)]
76+
[!code-vb[VbRaddataSaving#15](../data-tools/codesnippet/VisualBasic/insert-new-records-into-a-database_2.vb)]
77+
[!code-csharp[VbRaddataSaving#15](../data-tools/codesnippet/CSharp/insert-new-records-into-a-database_2.cs)]
7978

8079
## Insert new records by using command objects
81-
The following example inserts new records directly into a database using command objects.
82-
83-
The following procedure uses the `Region` table in the Northwind database as an example.
80+
You can insert new records directly into a database using command objects.
8481

8582
#### To insert new records into a database by using command objects
8683

8784
- Create a new command object, and then set its `Connection`, `CommandType`, and `CommandText` properties.
85+
86+
The following example demonstrates inserting records into a database using command object. It inserts data into the `Region` table in the Northwind database.
8887

89-
[!code-vb[VbRaddataSaving#16](../data-tools/codesnippet/VisualBasic/insert-new-records-into-a-database_3.vb)]
90-
[!code-csharp[VbRaddataSaving#16](../data-tools/codesnippet/CSharp/insert-new-records-into-a-database_3.cs)]
88+
[!code-vb[VbRaddataSaving#16](../data-tools/codesnippet/VisualBasic/insert-new-records-into-a-database_3.vb)]
89+
[!code-csharp[VbRaddataSaving#16](../data-tools/codesnippet/CSharp/insert-new-records-into-a-database_3.cs)]
9190

9291
## .NET Framework Security
9392
You must have access to the database you are trying to connect to, as well as permission to perform inserts into the desired table.

0 commit comments

Comments
 (0)