Archive

Archive for the ‘OData’ Category

Consuming SQL Azure OData Service using OData Explorer

May 11, 2011 Leave a comment

OData Explorer is free Sample Silverlight Application available in http://www.silverlight.net/content/samples/odataexplorer/

To run this you should have Silverlight 4.0 Runtime installed

Step 1: Click on the above URL to browse the application online. To Access SQL Azure OData service, You need to install it as Out of Browser application or else you will get the following error while adding the service to workspace

clip_image001

To avoid this, right click and click “Install OData Explorer onto this computer…”

clip_image002

Once installed, you will see the below shortcut in your desktop, double click the short cut to run OData Explorer

clip_image003

Step 2: By default, it will prompt you to add a new OData Service to Workspace

clip_image004

Please provide workspace name and enter the SQL OData Service URI and then click “Ok”

Step 3: Once successfully added, you will see below screen showing the list of Data Collections available through the SQL Azure OData service

clip_image006

Step 4: To browse data you can click on any table and data will be loaded on the right pane

clip_image008

Step 5: To filter the data, you can use “Build Query” option and then select the field name and then specify criteria and filter value and click “Add Query Option” to add the filter

clip_image009

clip_image010

Click “Ok” and then click “Go” on workspace to apply the filter on the data

clip_image012

Step 6: To Edit the record, click on “Edit”

clip_image013

To modify the data, you can change the required values and click “Save Changes” and to delete the entire record use “Delete” option

This is not full fledged data management interface, but it provides quick access to your data with no need to write any code

Happy OData Exploring and Programming !!!

SQL Azure OData Service –Publish your data as service painlessly

May 10, 2011 Leave a comment

SQL Azure OData Service is a beta project from SQL Azure Labs. You can sign up for free trial account from http://www.sqlazurelabs.com/

OData (Open Data Protocol) is Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. For more information about OData, please visit http://www.odata.org/ 

Step 1: After signing up, click on “SQL Azure OData Service” and then read and accept the terms of use and click “Register” to start

image

clip_image002

Step 2: To Configure OData service, provide the SQL Azure server name and credentials and click “Connect”

clip_image004

Step 3: Select Database which you want to publish using OData Service and click on “Enable OData”

clip_image006

 

Step 4: After selecting the database, select which users can access the data and whether Anonymous Access is allowed or not

Click “Add User” to add a new user

clip_image007

The users should be already added in SQL Azure Server and Database to enable access over OData

Once the user is added, a Unique OData link and Secret Key to access the database will be generated

clip_image009

To remove an existing User, click “Remove”

To provide read only access, please make sure to add a user who has only SELECT permissions is added in OData

To Enable Anonymous access, select the User account to be used for Anonymous acccess

image

Now you are ready to consume the Database using any OData client. Please see the below screenshot showing the data being browsed directly in Internet Explorer

image

You can access OData Service from .Net 3.5 or 4.0 or Silverlight 4.0 based application.

The following features are not available in SQL Azure OData Service at this point of time

1. Ability to control what tables to be published over OData service

2. Option to publish Views or Stored Procedures or Functions

This is a beta product, so don’t use this for production applications and also be aware of the data you are publishing with anonymous access, since anyone who with the URI can access the data.