Database Reference
In-Depth Information
2.
Before you can start coding and consuming the OData service, you need to do
a couple of things. First, the OData Client Library installation extracted a file
called System.Data.Services.Client.dll . In Solution Explorer, right-click the
References node, and select Add Reference. In the Add Reference dialog,
browse to the directory where you extracted the DLL file, and add that file to
your references.
3.
Next, you need to create a service proxy class that your OData service will use.
Open a command prompt, and navigate to the following folder:
C:\Windows\Microsoft.Net\Framework\v4.0.30319\ .
Enter the following command:
datasvcutil.exe /uri:https://odata.sqlazurelabs.com/OData.svc/v0.1/ servername /
TechBio /out:C:\ directory \TechBio.cs /Version:2.0 /DataServiceCollection
DataSvcUtil is a command-line tool provided by WCF Data Services that consumes
an OData feed and generates the client data service class or classes that are needed
to access a data service in a .NET client application. In this above, where you see
bolded and italicized text, be sure to enter your SQL Azure server and the directory
in which you want to save the proxy class.
4.
5.
Press the Enter key to generate the proxy class. Figure 7-15 shows the results.
Figure 7-15. Creating the proxy class
If no errors are generated, you're set to go. The next step is to include this file in your project:
6.
Right-click the project name in Solution Explorer, and select Add
Existing
Item from the context menu. Navigate to the directory where you create the
proxy class, and add the proxy class to your project.
Search WWH ::




Custom Search