NerdyHearn
Home

IPhone SMS To Gmail

Consulting
Security Alerts

Blog
Software
Projects
Links
About
Contact

Blog
FriendFeed
Facebook
Flickr
Twitter
Toluu
Last.fm
Picasa
LinkedIn

NerdyHearn - Blog


<< Back To All Blogs

Querying Table Entities with Microsoft Azure (And ADO.NET Data Services Framework)

Thursday, November 6th, 2008

I have been doing a lot of work lately with Microsoft Azure and specifically with the Tables in Microsoft Azure. During my work with the tables I was unable to find any up-front, easy to use examples of "queries" for entities in tables (otherwise known as filters by Azure terms). Here are some common rules which are important to know followed by some very basic examples of queries.

Most important: strings are enclosed in single quotes.

Sub-queries (aka sub-filters) are enclosed in single parenthesis ( and ).

Sub-queries are and'd and or'd outside and between parenthesis.

Comparisons are used as short-handed English-variant operators, such as ge for Greater then or equal to (>=), ne for Not equal to (!= or <>), and so on.

Without further ado, here are some examples:

Rows where the firstname column is equal to "tom":
$filter=(firstname eq 'tom')

Rows where the firstname column is not equal to "tom":
$filter=(firstname ne 'tom')

Rows where the counter column is greater then 5:
$filter=(counter gt 5)

Rows where the counter column is greater then 5 and less then 15:
$filter=(counter gt 5)and(counter lt 15)

Rows where the counter is greater then 20 or less then 10:
$filter=(counter gt 20)or(counter lt 10)

The same query syntax should also be useable with ADO.NET Data Services Framework although I have not confirmed this as of yet.

$filter=(blog eq 'Tom Out')

Tags

CSharp

Related Blogs

Reading Digital Signatures from InfoPath Forms in MOSS 2007 and WSS 3.0 Workflow
Enumerating all attributes of an element and adding them to a dictionary using LINQ with Lambda Expressions
Creating High Quality Images with C# and GDI
Enumerating the values of an enum in C#

Comments

Currently no comments.

Add A Comment

Name:


URL:


Email Address: (not public, used to send notifications on further comments)


Comments:


Please enter the text from the image:



NerdyHearn - Latest tech news relating to C#, SharePoint, PHP, general development, and more. LiveNation Feed - Feeds of all your local artists, concerts, and events through your favorite RSS reader SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers Tweets2Mail - Backup and search your twitter stream from Gmail TimeSinceI - Track how long you have quit smoking, how long you have been married, or how long you have done anything.