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/walkthrough-creating-a-simple-wcf-service-in-windows-forms.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -19,14 +19,14 @@ ms.technology: vs-data-tools
19
19
ms.workload:
20
20
- "data-storage"
21
21
---
22
-
# Walkthrough: Creating a simple WCF Service in Windows Forms
22
+
# Walkthrough: Create a simple WCF Service in Windows Forms
23
23
This walkthrough demonstrates how to create a simple [!INCLUDE[vsindigo](../data-tools/includes/vsindigo_md.md)] service, test it, and then access it from a Windows Forms application.
Copy file name to clipboardExpand all lines: docs/data-tools/walkthrough-creating-a-wcf-data-service-with-wpf-and-entity-framework.md
+34-34Lines changed: 34 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@ ms.workload:
22
22
# Walkthrough: Creating a WCF Data Service with WPF and Entity Framework
23
23
This walkthrough demonstrates how to create a simple [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)] that is hosted in an [!INCLUDE[vstecasp](../code-quality/includes/vstecasp_md.md)] Web application and then access it from a Windows Forms application.
24
24
25
-
In this walkthrough you will:
25
+
In this walkthrough you:
26
26
27
27
- Create a Web application to host a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)].
28
28
29
-
- Create an [!INCLUDE[adonet_edm](../data-tools/includes/adonet_edm_md.md)] that represents the Customers table in the Northwind database.
29
+
- Create an [!INCLUDE[adonet_edm](../data-tools/includes/adonet_edm_md.md)] that represents the `Customers` table in the Northwind database.
30
30
31
31
- Create a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)].
32
32
@@ -39,42 +39,42 @@ In this walkthrough you will:
39
39
## Prerequisites
40
40
This walkthrough uses SQL Server Express LocalDB and the Northwind sample database.
41
41
42
-
1. If you don't have SQL Server Express LocalDB, install it either from the [SQL Server Express download page](https://www.microsoft.com/sql-server/sql-server-editions-express), or through the **Visual Studio Installer**. In the Visual Studio Installer, SQL Server Express LocalDB can be installed as part of the **Data storage and processing** workload, or as an individual component.
42
+
1. If you don't have SQL Server Express LocalDB, install it either from the [SQL Server Express download page](https://www.microsoft.com/sql-server/sql-server-editions-express), or through the **Visual Studio Installer**. In the **Visual Studio Installer**, you can install SQL Server Express LocalDB as part of the **Data storage and processing** workload, or as an individual component.
43
43
44
44
2. Install the Northwind sample database by following these steps:
45
45
46
-
1. In Visual Studio, open the **SQL Server Object Explorer** window. (SQL Server Object Explorer is installed as part of the **Data storage and processing** workload in the Visual Studio Installer.) Expand the **SQL Server** node. Right-click on your LocalDB instance and select **New Query**.
46
+
1. In Visual Studio, open the **SQL Server Object Explorer** window. (**SQL Server Object Explorer** is installed as part of the **Data storage and processing** workload in the Visual Studio Installer.) Expand the **SQL Server** node. Right-click on your LocalDB instance and select **New Query**.
47
47
48
48
A query editor window opens.
49
49
50
50
2. Copy the [Northwind Transact-SQL script](https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/data-tools/samples/northwind.sql?raw=true) to your clipboard. This T-SQL script creates the Northwind database from scratch and populates it with data.
51
51
52
52
3. Paste the T-SQL script into the query editor, and then choose the **Execute** button.
53
53
54
-
After a short time, the query finishes executing and the Northwind database is created.
54
+
After a short time, the query finishes running and the Northwind database is created.
55
55
56
56
## Creating the Service
57
57
To create a [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)], you will add a Web project, create an [!INCLUDE[adonet_edm](../data-tools/includes/adonet_edm_md.md)], and then create the service from the model.
58
58
59
-
In the first step, you will add a Web project to host the service.
59
+
In the first step, you add a Web project to host the service.
1. On the menu bar, choose **File**, **New**, **Project**.
65
+
1. On the menu bar, choose **File** > **New** >**Project**.
66
66
67
67
2. In the **New Project** dialog box, expand the **Visual Basic** or **Visual C#** and **Web** nodes, and then choose the **ASP.NET Web Application** template.
68
68
69
69
3. In the **Name** text box, enter **NorthwindWeb**, and then choose the **OK** button.
70
70
71
71
4. In the **New ASP.NET Project** dialog box, in the **Select a template** list, choose **Empty**, and then choose the **OK** button.
72
72
73
-
In the next step, you will create an [!INCLUDE[adonet_edm](../data-tools/includes/adonet_edm_md.md)] that represents the Customers table in the Northwind database.
73
+
In the next step, you create an [!INCLUDE[adonet_edm](../data-tools/includes/adonet_edm_md.md)] that represents the `Customers` table in the Northwind database.
74
74
75
75
#### To create the Entity Data Model
76
76
77
-
1. On the menu bar, choose **Project**,**Add New Item**.
77
+
1. On the menu bar, choose **Project** >**Add New Item**.
78
78
79
79
2. In the **Add New Item** dialog box, choose the **Data** node, and then choose the **ADO.NET Entity Data Model** item.
80
80
@@ -104,19 +104,19 @@ In the next step, you will create an [!INCLUDE[adonet_edm](../data-tools/include
104
104
105
105
8. On the **Choose Your Database Objects** page, expand the **Tables** node, select the **Customers** check box, and then choose the **Finish** button.
106
106
107
-
The entity model diagram will be displayed, and a NorthwindModel.edmx file will be added to your project.
107
+
The entity model diagram displays, and a *NorthwindModel.edmx* file is added to your project.
108
108
109
-
In the next step, you will create and test the data service.
109
+
In the next step, you create and test the data service.
110
110
111
111
#### To create the data service
112
112
113
-
1. On the menu bar, choose **Project**,**Add New Item**.
113
+
1. On the menu bar, choose **Project** >**Add New Item**.
114
114
115
115
2. In the **Add New Item** dialog box, choose the **Web** node, and then choose the **WCF Data Service 5.6** item.
116
116
117
117
3. In the **Name** text box, enter `NorthwindCustomers`, and then choose the **Add** button.
118
118
119
-
The NorthwindCustomers.svc file appears in the **Code Editor**.
119
+
The **NorthwindCustomers.svc** file appears in the **Code Editor**.
120
120
121
121
4. In the **Code Editor**, locate the first `TODO:` comment and replace the code with the following:
122
122
@@ -128,53 +128,53 @@ In the next step, you will create and test the data service.
6. On the menu bar, choose **Debug**, **Start Without Debugging** to run the service. A browser window opens and the XML schema for the service is displayed.
131
+
6. On the menu bar, choose **Debug** > **Start Without Debugging** to run the service. A browser window opens and the XML schema for the service displays.
132
132
133
-
7. In the **Address** bar, enter `Customers` at the end of the URL for NorthwindCustomers.svc, and then choose the **ENTER** key.
133
+
7. In the **Address** bar, enter `Customers` at the end of the URL for **NorthwindCustomers.svc**, and then choose the **Enter** key.
134
134
135
-
An XML representation of the data in the Customers table is displayed.
135
+
An XML representation of the data in the `Customers` table appears.
136
136
137
137
> [!NOTE]
138
-
> In some cases, Internet Explorer will misinterpret the data as an RSS feed. You must make sure that the option to display RSS feeds is disabled. For more information, see [Troubleshooting Service References](../data-tools/troubleshooting-service-references.md).
138
+
> In some cases, Internet Explorer will misinterpret the data as an RSS feed. You must make sure that the option to display RSS feeds is disabled. For more information, see [Troubleshooting service references](../data-tools/troubleshooting-service-references.md).
139
139
140
140
8. Close the browser window.
141
141
142
-
In the next steps, you will create a Windows Forms client application to consume the service.
142
+
In the next steps, you create a Windows Forms client application to consume the service.
143
143
144
144
## Creating the Client Application
145
-
To create the client application, you will add a second project, add a service reference to the project, configure a data source, and create a user interface to display the data from the service.
145
+
To create the client application, you add a second project, add a service reference to the project, configure a data source, and create a user interface to display the data from the service.
146
146
147
-
In the first step, you will add a Windows Forms project to the solution and set it as the startup project.
147
+
In the first step, you add a Windows Forms project to the solution and set it as the startup project.
148
148
149
149
#### To create the client application
150
150
151
151
1. On the menu bar, choose File, **Add** > **New Project**.
152
152
153
-
2. In the **New Project** dialog box, expand the **Visual Basic** or **Visual C#** node and choose the **Windows** node, and then choose **Windows Forms Application**.
153
+
2. In the **New Project** dialog box, expand the **Visual Basic** or **Visual C#** node, choose the **Windows** node, and then choose **Windows Forms Application**.
154
154
155
155
3. In the **Name** text box, enter `NorthwindClient`, and then choose the **OK** button.
156
156
157
157
4. In **Solution Explorer**, choose the **NorthwindClient** project node.
158
158
159
159
5. On the menu bar, choose **Project**, **Set as StartUp Project**.
160
160
161
-
In the next step, you will add a service reference to the [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)] in the Web project.
161
+
In the next step, you add a service reference to the [!INCLUDE[ss_data_service](../data-tools/includes/ss_data_service_md.md)] in the Web project.
162
162
163
163
#### To add a service reference
164
164
165
-
1. On the menu bar, choose **Project**,**Add Service Reference**.
165
+
1. On the menu bar, choose **Project** >**Add Service Reference**.
166
166
167
167
2. In the **Add Service Reference** dialog box, choose the **Discover** button.
168
168
169
169
The URL for the NorthwindCustomers service appears in the **Address** field.
170
170
171
171
3. Choose the **OK** button to add the service reference.
172
172
173
-
In the next step, you will configure a data source to enable data binding to the service.
173
+
In the next step, you configure a data source to enable data binding to the service.
174
174
175
175
#### To enable data binding to the service
176
176
177
-
1. On the menu bar, choose **View**, **Other Windows**,**Data Sources**.
177
+
1. On the menu bar, choose **View** > **Other Windows** >**Data Sources**.
178
178
179
179
2. In the **Data Sources** window, choose the **Add New Data Source** button.
180
180
@@ -184,7 +184,7 @@ In the next step, you will configure a data source to enable data binding to the
184
184
185
185
5. Select **Customer** check box, and then choose the **Finish** button.
186
186
187
-
In the next step, you will create the user interface that will display the data from the service.
187
+
In the next step, you create the user interface that displays the data from the service.
188
188
189
189
#### To create the user interface
190
190
@@ -196,7 +196,7 @@ In the next step, you will create the user interface that will display the data
196
196
197
197
3. Choose the **CustomersDataGridView** control, and then in the **Properties** window set the **Dock** property to **Fill**.
198
198
199
-
4. In **Solution Explorer**, open the shortcut menu for the **Form1** node and choose **View Code** to open the Code Editor, and add the following Imports or Using statement at the top of the file:
199
+
4. In **Solution Explorer**, open the shortcut menu for the **Form1** node and choose **View Code** to open the Code Editor, and add the following `Imports` or `Using` statement at the top of the file:
200
200
201
201
```vb
202
202
ImportsNorthwindClient.ServiceReference1
@@ -225,28 +225,28 @@ In the next step, you will create the user interface that will display the data
0 commit comments