Skip to content

Commit 96c7941

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/visualstudio-docs-pr into python5
2 parents e012faa + 5872426 commit 96c7941

File tree

43 files changed

+663
-691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+663
-691
lines changed

.openpublishing.publish.config.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@
116116
]
117117
},
118118
"need_generate_pdf_url_template": true,
119-
"targets": {},
119+
"Targets": {
120+
"Pdf": {
121+
"template_folder": "_themes.pdf"
122+
}
123+
},
120124
"need_generate_pdf": false,
121125
"need_generate_intellisense": false
122-
}
126+
}

docs/data-tools/bind-wpf-controls-to-a-wcf-data-service.md

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,24 @@ ms.workload:
2020
---
2121
# Bind WPF controls to a WCF data service
2222

23-
In this walkthrough, you will create a WPF application that contains data-bound controls. The controls are bound to customer records that are encapsulated in a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)]. You will also add buttons that customers can use to view and update records.
23+
In this walkthrough, you will create a WPF application that contains data-bound controls. The controls are bound to customer records that are encapsulated in a WCF Data Service. You will also add buttons that customers can use to view and update records.
2424

2525
This walkthrough illustrates the following tasks:
2626

2727
- Creating an Entity Data Model that is generated from data in the AdventureWorksLT sample database.
2828

29-
- Creating a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)] that exposes the data in the Entity Data Model to a WPF application.
29+
- Creating a WCF Data Service that exposes the data in the Entity Data Model to a WPF application.
3030

3131
- Creating a set of data-bound controls by dragging items from the **Data Sources** window to the WPF designer.
3232

3333
- Creating buttons that navigate forward and backward through customer records.
3434

35-
- Creating a button that saves changes to data in the controls to the [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)] and the underlying data source.
35+
- Creating a button that saves changes to data in the controls to the WCF Data Service and the underlying data source.
3636

3737
[!INCLUDE[note_settings_general](../data-tools/includes/note_settings_general_md.md)]
3838

3939
## Prerequisites
40+
4041
You need the following components to complete this walkthrough:
4142

4243
- Visual Studio
@@ -54,9 +55,8 @@ Prior knowledge of the following concepts is also helpful, but not required to c
5455
- WPF data binding. For more information, see [Data Binding overview](/dotnet/framework/wpf/data/data-binding-overview).
5556

5657
## Create the service project
57-
Start this walkthrough by creating a project for a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)].
5858

59-
### To create the service project
59+
Start this walkthrough by creating a project for a WCF Data Service:
6060

6161
1. Start Visual Studio.
6262

@@ -66,16 +66,15 @@ Start this walkthrough by creating a project for a [!INCLUDE[ss_data_service](..
6666

6767
4. Select the **ASP.NET Web Application** project template.
6868

69-
5. In the **Name** box, type `AdventureWorksService` and click **OK**.
69+
5. In the **Name** box, type **AdventureWorksService** and click **OK**.
7070

71-
Visual Studio creates the `AdventureWorksService` project.
71+
Visual Studio creates the **AdventureWorksService** project.
7272

7373
6. In **Solution Explorer**, right-click **Default.aspx** and select **Delete**. This file is not necessary in this walkthrough.
7474

7575
## Create an Entity Data Model for the service
76-
To expose data to an application by using a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)], you must define a data model for the service. The [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)] supports two types of data models: Entity Data Models, and custom data models that are defined by using common language runtime (CLR) objects that implement the <xref:System.Linq.IQueryable%601> interface. In this walkthrough, you create an Entity Data Model for the data model.
7776

78-
### To create an Entity Data Model
77+
To expose data to an application by using a WCF Data Service, you must define a data model for the service. The WCF Data Service supports two types of data models: Entity Data Models, and custom data models that are defined by using common language runtime (CLR) objects that implement the <xref:System.Linq.IQueryable%601> interface. In this walkthrough, you create an Entity Data Model for the data model.
7978

8079
1. On the **Project** menu, click **Add New Item**.
8180

@@ -100,9 +99,8 @@ To expose data to an application by using a [!INCLUDE[ss_data_service](../data-t
10099
8. Click **Finish**.
101100

102101
## Create the service
103-
Create a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)] to expose the data in the Entity Data Model to a WPF application.
104102

105-
### To create the service
103+
Create a WCF Data Service to expose the data in the Entity Data Model to a WPF application:
106104

107105
1. On the **Project** menu, select **Add New Item**.
108106

@@ -113,23 +111,21 @@ Create a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md
113111
Visual Studio adds the `AdventureWorksService.svc` to the project.
114112

115113
## Configure the service
116-
You must configure the service to operate on the Entity Data Model that you created.
117114

118-
### To configure the service
115+
You must configure the service to operate on the Entity Data Model that you created:
119116

120-
1. In the `AdventureWorks.svc` code file, replace the `AdventureWorksService` class declaration with the following code.
117+
1. In the `AdventureWorks.svc` code file, replace the **AdventureWorksService** class declaration with the following code.
121118

122119
[!code-csharp[Data_WPFWCF#1](../data-tools/codesnippet/CSharp/bind-wpf-controls-to-a-wcf-data-service_1.cs)]
123120
[!code-vb[Data_WPFWCF#1](../data-tools/codesnippet/VisualBasic/bind-wpf-controls-to-a-wcf-data-service_1.vb)]
124121

125-
This code updates the `AdventureWorksService` class, so that it derives from a <xref:System.Data.Services.DataService%601> that operates on the `AdventureWorksLTEntities` object context class in your Entity Data Model. It also updates the `InitializeService` method to allow clients of the service full read/write access to the `SalesOrderHeader` entity.
122+
This code updates the **AdventureWorksService** class, so that it derives from a <xref:System.Data.Services.DataService%601> that operates on the `AdventureWorksLTEntities` object context class in your Entity Data Model. It also updates the `InitializeService` method to allow clients of the service full read/write access to the `SalesOrderHeader` entity.
126123

127124
2. Build the project, and verify that it builds without errors.
128125

129126
## Create the WPF client application
130-
To display the data from the [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)], create a new WPF application with a data source that is based on the service. Later in this walkthrough, you will add data-bound controls to the application.
131127

132-
### To create the WPF client application
128+
To display the data from the WCF Data Service, create a new WPF application with a data source that is based on the service. Later in this walkthrough, you will add data-bound controls to the application.
133129

134130
1. In **Solution Explorer**, right-click the solution node, click **Add**, and select **New Project**.
135131

@@ -155,7 +151,7 @@ To display the data from the [!INCLUDE[ss_data_service](../data-tools/includes/s
155151

156152
Visual Studio searches the current solution for available services, and adds `AdventureWorksService.svc` to the list of available services in the **Services** box.
157153

158-
9. In the **Namespace** box, type `AdventureWorksService`.
154+
9. In the **Namespace** box, type **AdventureWorksService**.
159155

160156
10. In the **Services** box, click **AdventureWorksService.svc**, and then click **OK**.
161157

@@ -165,10 +161,9 @@ To display the data from the [!INCLUDE[ss_data_service](../data-tools/includes/s
165161

166162
Visual Studio adds nodes that represent the data returned by the service to the **Data Sources** window.
167163

168-
## Define the user interface of the window
169-
Add several buttons to the window by modifying the XAML in the WPF designer. Later in this walkthrough, you will add code that enables users to view and update sales records by using these buttons.
164+
## Define the user interface
170165

171-
### To create the window layout
166+
Add several buttons to the window by modifying the XAML in the WPF designer. Later in this walkthrough, you will add code that enables users to view and update sales records by using these buttons.
172167

173168
1. In **Solution Explorer**, double-click **MainWindow.xaml**.
174169

@@ -189,9 +184,8 @@ Add several buttons to the window by modifying the XAML in the WPF designer. Lat
189184
3. Build the project.
190185

191186
## Create the data-bound controls
192-
Create controls that display customer records by dragging the `SalesOrderHeaders` node from the **Data Sources** window to the designer.
193187

194-
### To create the data-bound controls
188+
Create controls that display customer records by dragging the `SalesOrderHeaders` node from the **Data Sources** window to the designer.
195189

196190
1. In the **Data Sources** window, click the drop-down menu for the **SalesOrderHeaders** node, and select **Details**.
197191

@@ -228,9 +222,8 @@ Create controls that display customer records by dragging the `SalesOrderHeaders
228222
- **Sales Order Number**
229223

230224
## Load the data from the service
231-
Use the service proxy object to load sales data from the service. Then assign the returned data to the data source for the <xref:System.Windows.Data.CollectionViewSource> in the WPF window.
232225

233-
### To load the data from the service
226+
Use the service proxy object to load sales data from the service. Then assign the returned data to the data source for the <xref:System.Windows.Data.CollectionViewSource> in the WPF window.
234227

235228
1. In the designer, to create the `Window_Loaded` event handler, double-click the text that reads: **MainWindow**.
236229

@@ -240,9 +233,8 @@ Use the service proxy object to load sales data from the service. Then assign th
240233
[!code-vb[Data_WPFWCF#2](../data-tools/codesnippet/VisualBasic/bind-wpf-controls-to-a-wcf-data-service_2.vb)]
241234

242235
## Navigate sales records
243-
Add code that enables users to scroll through sales records by using the **\<** and **>** buttons.
244236

245-
### To enable users to navigate sales records
237+
Add code that enables users to scroll through sales records by using the **\<** and **>** buttons.
246238

247239
1. In the designer, double-click the **<** button on the window surface.
248240

@@ -262,10 +254,9 @@ Add code that enables users to scroll through sales records by using the **\<**
262254
[!code-csharp[Data_WPFWCF#4](../data-tools/codesnippet/CSharp/bind-wpf-controls-to-a-wcf-data-service_4.cs)]
263255
[!code-vb[Data_WPFWCF#4](../data-tools/codesnippet/VisualBasic/bind-wpf-controls-to-a-wcf-data-service_4.vb)]
264256

265-
## Saving changes to sales records
266-
Add code that enables users to both view and save changes to sales records by using the **Save changes** button.
257+
## Save changes to sales records
267258

268-
### To add the ability to save changes to sales records
259+
Add code that enables users to both view and save changes to sales records by using the **Save changes** button:
269260

270261
1. In the designer, double-click the **Save Changes** button.
271262

@@ -276,10 +267,9 @@ Add code that enables users to both view and save changes to sales records by us
276267
[!code-csharp[Data_WPFWCF#5](../data-tools/codesnippet/CSharp/bind-wpf-controls-to-a-wcf-data-service_5.cs)]
277268
[!code-vb[Data_WPFWCF#5](../data-tools/codesnippet/VisualBasic/bind-wpf-controls-to-a-wcf-data-service_5.vb)]
278269

279-
## Testing the application
280-
Build and run the application to verify that you can view and update customer records.
270+
## Test the application
281271

282-
### To test the application
272+
Build and run the application to verify that you can view and update customer records:
283273

284274
1. On **Build** menu, click **Build Solution**. Verify that the solution builds without errors.
285275

docs/data-tools/create-a-sql-database-by-using-a-designer.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ ms.workload:
1616
- "data-storage"
1717
---
1818
# Create a database and add tables in Visual Studio
19+
1920
You can use Visual Studio to create and update a local database file in SQL Server Express LocalDB. You can also create a database by executing Transact-SQL statements in the **SQL Server Object Explorer** tool window in Visual Studio. In this topic, we'll create an *.mdf* file and add tables and keys by using the Table Designer.
2021

2122
## Prerequisites
23+
2224
To complete this walkthrough, you must have the optional **Data storage and processing** workload installed in Visual Studio. To install it, open **Visual Studio Installer** and choose the **Workloads** tab. Under **Web & Cloud**, choose **Data storage and processing**. Choose the **Modify** button to add the workload to Visual Studio.
2325

2426
## Create a project and a local database file
2527

26-
### To create a project and a database file
27-
1. Create a Windows Forms project that's named `SampleDatabaseWalkthrough`.
28+
1. Create a Windows Forms project that's named **SampleDatabaseWalkthrough**.
2829

2930
2. On the menu bar, select **Project** > **Add New Item**.
3031

@@ -35,6 +36,7 @@ To complete this walkthrough, you must have the optional **Data storage and proc
3536
4. Name the database **SampleDatabase**, and then select the **Add** button.
3637

3738
### To add a data source
39+
3840
5. If the **Data Sources** window isn't open, open it by selecting the **Shift**+**Alt**+**D** keys or, on the menu bar, select **View** > **Other Windows** > **Data Sources**.
3941

4042
6. In the **Data Sources** window, select the **Add New Data Source** link.
@@ -52,16 +54,19 @@ To complete this walkthrough, you must have the optional **Data storage and proc
5254
11. One the **Choose your Database Objects** page, you'll see a message that says the database doesn't contain any objects. Choose **Finish**.
5355

5456
### To view properties of the data connection
57+
5558
You can view the connection string for the *SampleDatabase.mdf* file by opening the properties window of the data connection:
5659

5760
- In Visual Studio, select **View** > **SQL Server Object Explorer** if that window isn't already open. Open the properties window by expanding the **Data Connections** node, opening the shortcut menu for *SampleDatabase.mdf*, and then selecting **Properties**.
5861

5962
- Alternatively, you can select **View** > **Server Explorer**, if that window isn't already open. Open the properties window by expanding the **Data Connections** node. Open the shortcut menu for *SampleDatabase.mdf*, and then select **Properties**.
6063

6164
## Create tables and keys by using Table Designer
65+
6266
In this section, you'll create two tables, a primary key in each table, and a few rows of sample data. You'll also create a foreign key to specify how records in one table correspond to records in the other table.
6367

6468
### To create the Customers table
69+
6570
1. In **Server Explorer** or **SQL Server Object Explorer**, expand the **Data Connections** node, and then expand the **SampleDatabase.mdf** node.
6671

6772
2. Open the shortcut menu for **Tables**, and then select **Add New Table**.
@@ -98,6 +103,7 @@ In this section, you'll create two tables, a primary key in each table, and a fe
98103
Your changes are saved to the local database file.
99104

100105
### To create the Orders table
106+
101107
1. Add another table, and then add a row for each entry in the following table:
102108

103109
|Column name|Data type|Allow nulls|
@@ -122,11 +128,12 @@ In this section, you'll create two tables, a primary key in each table, and a fe
122128
Your changes are saved to the local database file.
123129

124130
### To create a foreign key
131+
125132
1. In the context pane on the right side of the grid, open the shortcut menu for **Foreign Keys**, and then select **Add New Foreign Key**, as the following illustration shows.
126133

127134
![Adding a foreign key in Table Designer](../data-tools/media/foreignkey.png)
128135

129-
2. In the text box that appears, replace **ToTable** with `Customers`.
136+
2. In the text box that appears, replace **ToTable** with **Customers**.
130137

131138
3. In the T-SQL pane, update the last line to match the following sample:
132139

@@ -142,8 +149,6 @@ In this section, you'll create two tables, a primary key in each table, and a fe
142149

143150
## Populate the tables with data
144151

145-
### To populate the tables with data
146-
147152
1. In **Server Explorer** or **SQL Server Object Explorer**, expand the node for the sample database.
148153

149154
2. Open the shortcut menu for the **Tables** node, select **Refresh**, and then expand the **Tables** node.

0 commit comments

Comments
 (0)