You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/data-tools/accessing-data-in-visual-studio.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -81,7 +81,7 @@ In Visual Studio, you can create applications that connect to data in virtually
81
81
82
82
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).
83
83
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).
85
85
86
86
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.
Copy file name to clipboardExpand all lines: docs/data-tools/create-and-configure-tableadapters.md
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,11 @@ The **Advanced Options** in the wizard enable you to:
78
78
79
79
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.
80
80
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`:
Copy file name to clipboardExpand all lines: docs/data-tools/edit-data-in-datasets.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -82,9 +82,9 @@ You edit data in data tables much like you edit the data in a table in any datab
82
82
83
83
Changes are tracked two ways in each data row:
84
84
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>).
86
86
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.
88
88
89
89
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.
Copy file name to clipboardExpand all lines: docs/data-tools/handle-a-concurrency-exception.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -138,7 +138,7 @@ Concurrency exceptions (<xref:System.Data.DBConcurrencyException>) are raised wh
138
138
139
139
- The proposed changes in the dataset
140
140
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.
142
142
143
143
#### To enable the handling of concurrency errors
144
144
@@ -153,7 +153,7 @@ Concurrency exceptions (<xref:System.Data.DBConcurrencyException>) are raised wh
153
153
### Add code to handle the concurrency exception
154
154
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.
155
155
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.
157
157
158
158
> [!NOTE]
159
159
> 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
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.
175
175
176
176
##### To create the message to display to the user
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.
103
103
104
104
> [!NOTE]
105
105
> 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.
Copy file name to clipboardExpand all lines: docs/data-tools/insert-new-records-into-a-database.md
+16-17Lines changed: 16 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -58,36 +58,35 @@ To insert new records into a database, you can use the `TableAdapter.Update` met
58
58
59
59
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>.
60
60
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.)
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.
#### 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.
71
68
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.
73
72
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.
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.
84
81
85
82
#### To insert new records into a database by using command objects
86
83
87
84
- 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.
0 commit comments