<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Stephen Forte`s Blog</title>
    <link>http://www.stephenforte.net/</link>
    <description>Sex, Drugs, and .NET</description>
    <language>en-us</language>
    <copyright>Stephen Forte</copyright>
    <lastBuildDate>Sat, 07 Nov 2009 08:17:24 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>stevef@orcsweb.com</managingEditor>
    <webMaster>stevef@orcsweb.com</webMaster>
    <geo:lat>40.776777</geo:lat><geo:long>-73.954103</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/StephenFortesBlog" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=60e079ce-c140-4078-9026-79d9c79a2350</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,60e079ce-c140-4078-9026-79d9c79a2350.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,60e079ce-c140-4078-9026-79d9c79a2350.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=60e079ce-c140-4078-9026-79d9c79a2350</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,60e079ce-c140-4078-9026-79d9c79a2350.aspx";digg_title = "Speaking at TechEd Europe next week, SOLD OUT!";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
Next week I will be speaking at one of my favorite events, <a href="http://www.microsoft.com/europe/TechEd/">TechEd
Europe</a>, this year held in Berlin. While Barcelona is still my favorite city in
the world, I am glad that we are in Berlin this year, since Monday is the 20th anniversary
of the <a href="http://en.wikipedia.org/wiki/Berlin_Wall">Berlin Wall</a> falling,
and our world changing forever. 
</p>
        <p>
I will be speaking on:
</p>
        <ul>
          <li>
Agile Tools and Teams</li>
          <li>
            <a href="http://entdevcon.istreamplanet.com/video.asp?v=34">The Daily Scrum</a>
          </li>
          <li>
            <a href="http://www.stephenforte.net/PermaLink,guid,a46e5aaa-a494-42ad-aeeb-1069edf0bca1.aspx">Agile
Estimation</a>
          </li>
        </ul>
        <p>
I speak on Tuesday and Wednesday, and the event is SOLD OUT. I hope you were lucky
enough to get a ticket. I’ll be hanging out at the <a href="http://www.telerik.com">Telerik</a> booth
when I am not speaking if you want to come and say hi.
</p>
        <p>
          <a href="http://www.microsoft.com/europe/TechEd/">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/SpeakingatTechEdEuropenextweekSOLDOUT_E526/image_3.png" width="242" height="244" />
          </a>
        </p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8720f85a-1ec2-48b9-9b81-38a413a3e05e" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/TechEd" rel="tag">TechEd</a>,<a href="http://technorati.com/tags/Berlin+Wall" rel="tag">Berlin
Wall</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=60e079ce-c140-4078-9026-79d9c79a2350" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/eUnl-8JkbvI" height="1" width="1" /></body>
      <title>Speaking at TechEd Europe next week, SOLD OUT!</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,60e079ce-c140-4078-9026-79d9c79a2350.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/eUnl-8JkbvI/PermaLink,guid,60e079ce-c140-4078-9026-79d9c79a2350.aspx</link>
      <pubDate>Sat, 07 Nov 2009 08:17:24 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,60e079ce-c140-4078-9026-79d9c79a2350.aspx";digg_title = "Speaking at TechEd Europe next week, SOLD OUT!";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
Next week I will be speaking at one of my favorite events, &lt;a href="http://www.microsoft.com/europe/TechEd/"&gt;TechEd
Europe&lt;/a&gt;, this year held in Berlin. While Barcelona is still my favorite city in
the world, I am glad that we are in Berlin this year, since Monday is the 20th anniversary
of the &lt;a href="http://en.wikipedia.org/wiki/Berlin_Wall"&gt;Berlin Wall&lt;/a&gt; falling,
and our world changing forever. 
&lt;/p&gt;
&lt;p&gt;
I will be speaking on:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Agile Tools and Teams&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://entdevcon.istreamplanet.com/video.asp?v=34"&gt;The Daily Scrum&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://www.stephenforte.net/PermaLink,guid,a46e5aaa-a494-42ad-aeeb-1069edf0bca1.aspx"&gt;Agile
Estimation&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I speak on Tuesday and Wednesday, and the event is SOLD OUT. I hope you were lucky
enough to get a ticket. I’ll be hanging out at the &lt;a href="http://www.telerik.com"&gt;Telerik&lt;/a&gt; booth
when I am not speaking if you want to come and say hi.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.microsoft.com/europe/TechEd/"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/SpeakingatTechEdEuropenextweekSOLDOUT_E526/image_3.png" width="242" height="244" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8720f85a-1ec2-48b9-9b81-38a413a3e05e" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/TechEd" rel="tag"&gt;TechEd&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Berlin+Wall" rel="tag"&gt;Berlin
Wall&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=60e079ce-c140-4078-9026-79d9c79a2350" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,60e079ce-c140-4078-9026-79d9c79a2350.aspx</comments>
      <category>Speaking</category>
      <category>Tech*Ed 2004</category>
      <category>Telerik</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,60e079ce-c140-4078-9026-79d9c79a2350.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=e76260c8-9ebb-4dd5-8461-ef8e2119ba18</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,e76260c8-9ebb-4dd5-8461-ef8e2119ba18.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,e76260c8-9ebb-4dd5-8461-ef8e2119ba18.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=e76260c8-9ebb-4dd5-8461-ef8e2119ba18</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,e76260c8-9ebb-4dd5-8461-ef8e2119ba18.aspx";digg_title = "TechDays in Palestine";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
I have been supporting <a href="http://paldev.net/">PalDev</a>, the first (and I think
only) .NET User Group in Palestine for many years. It started as a vision of <a href="http://paldev.net/blogs/jihad/default.aspx">Jihad
Hammad</a> a friend of mine, about 6 years ago. Goksin Bakir, Malek Kemmu, and some
others in the community have also rallied behind PalDev.  This is a user group
that had its first meeting in a refugee camp, then moved to <a href="http://www.qou.edu/englishIndexPage.do">Al-Quds
Open University</a>. Now they have almost 200 members and just helped launch Windows
7 and organize Microsoft’s first ever TechDays in Palestine. 
</p>
        <p>
The event was a great success, held over three days in three cities in Palestine.
Attendance at the first day in Hebron, was about 250. Goksin was suppose to speak
at the event but did not have the proper visas and was turned away at the border,
so he went to Jordan and did a LiveMeeting! 
</p>
        <p>
This is a region with a tremendous amount of political instability, to say the least.
I encourage all members of the community to help out, contact Jihad and do a session
via LiveMeeting, or travel to Palestine and deliver a talk. You won’t regret it and
you will do more to bring peace to the Middle East then all of those politicians out
there.
</p>
        <p>
You can read <a href="http://paldev.net/blogs/jihad/archive/2009/11/04/palestine-microsoft-techdays-1st-day-the-start-and-the-end.aspx">Jihad’s
post here</a>. 
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/TechDaysinPalestine_E5A2/img02.jpg">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="img02" border="0" alt="img02" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/TechDaysinPalestine_E5A2/img02_thumb.jpg" width="509" height="383" />
          </a>
        </p>
        <p>
 
</p>
        <p>
        </p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:618b8d5a-08aa-4438-aedf-ff574ce06d36" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/PalDev" rel="tag">PalDev</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=e76260c8-9ebb-4dd5-8461-ef8e2119ba18" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/pjh4JhdW8VI" height="1" width="1" /></body>
      <title>TechDays in Palestine</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,e76260c8-9ebb-4dd5-8461-ef8e2119ba18.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/pjh4JhdW8VI/PermaLink,guid,e76260c8-9ebb-4dd5-8461-ef8e2119ba18.aspx</link>
      <pubDate>Fri, 06 Nov 2009 08:19:44 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,e76260c8-9ebb-4dd5-8461-ef8e2119ba18.aspx";digg_title = "TechDays in Palestine";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
I have been supporting &lt;a href="http://paldev.net/"&gt;PalDev&lt;/a&gt;, the first (and I think
only) .NET User Group in Palestine for many years. It started as a vision of &lt;a href="http://paldev.net/blogs/jihad/default.aspx"&gt;Jihad
Hammad&lt;/a&gt; a friend of mine, about 6 years ago. Goksin Bakir, Malek Kemmu, and some
others in the community have also rallied behind PalDev.&amp;#160; This is a user group
that had its first meeting in a refugee camp, then moved to &lt;a href="http://www.qou.edu/englishIndexPage.do"&gt;Al-Quds
Open University&lt;/a&gt;. Now they have almost 200 members and just helped launch Windows
7 and organize Microsoft’s first ever TechDays in Palestine. 
&lt;/p&gt;
&lt;p&gt;
The event was a great success, held over three days in three cities in Palestine.
Attendance at the first day in Hebron, was about 250. Goksin was suppose to speak
at the event but did not have the proper visas and was turned away at the border,
so he went to Jordan and did a LiveMeeting! 
&lt;/p&gt;
&lt;p&gt;
This is a region with a tremendous amount of political instability, to say the least.
I encourage all members of the community to help out, contact Jihad and do a session
via LiveMeeting, or travel to Palestine and deliver a talk. You won’t regret it and
you will do more to bring peace to the Middle East then all of those politicians out
there.
&lt;/p&gt;
&lt;p&gt;
You can read &lt;a href="http://paldev.net/blogs/jihad/archive/2009/11/04/palestine-microsoft-techdays-1st-day-the-start-and-the-end.aspx"&gt;Jihad’s
post here&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/TechDaysinPalestine_E5A2/img02.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="img02" border="0" alt="img02" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/TechDaysinPalestine_E5A2/img02_thumb.jpg" width="509" height="383" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:618b8d5a-08aa-4438-aedf-ff574ce06d36" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/PalDev" rel="tag"&gt;PalDev&lt;/a&gt;
&lt;/div&gt;
&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=e76260c8-9ebb-4dd5-8461-ef8e2119ba18" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,e76260c8-9ebb-4dd5-8461-ef8e2119ba18.aspx</comments>
      <category>PIT</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,e76260c8-9ebb-4dd5-8461-ef8e2119ba18.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=21936d4c-adad-454e-947a-6f3371bcdeb8</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,21936d4c-adad-454e-947a-6f3371bcdeb8.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,21936d4c-adad-454e-947a-6f3371bcdeb8.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=21936d4c-adad-454e-947a-6f3371bcdeb8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,21936d4c-adad-454e-947a-6f3371bcdeb8.aspx";digg_title = "Visual Studio 2010 should be free…..";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
I am in Hong Kong speaking at the <a href="http://www.hkcs.org.hk/hkicc2009/conference_programme.html">Hong
Kong International Computer Conference</a>. It is a great conference, it focuses on
IT as a driver for innovation and economic transformation. I was lucky enough to be
doing one of the keynote presentations on how technology is so disruptive and how
cloud computing changes entrepreneurship. In my talk I mention <a href="http://www.kurzweilai.net/articles/art0134.html?printable=1">Ray
Kurzweil’s Abstraction of Moore's Law</a>, which can be summarized as saying that
the next 20 years will see as much technological innovation as the past 100.
</p>
        <p>
I represented Microsoft Hong Kong in this talk, and after the speech lots of people
came up to me to chat. I got to talk to tons of folks at the conference: I got to
talk to students and professors at <a href="http://www.hku.hk/">Hong Kong University</a>,
the folks from <a href="http://laptop.org/en/">One Laptop per Child</a>, entrepreneurs
(including a <a href="http://www.intuitiveautomata.com/">dude building some amazing
robotics</a>), people form <a href="http://www.hkesd.org/">NGOs</a>, and local software
developers. We got to talking about how the new technology reality has drastically
changed business models. Think about digital media, the music industry has changed
forever, old business models just don’t work anymore.
</p>
        <p>
This got me thinking. Microsoft recently announced a great offer for <a href="http://www.microsoft.com/presspass/press/2009/oct09/10-19VSFinalStretchPR.mspx">Visual
Studio Ultimate</a> (yet another SKU). But the world has changed. Web 2.0 is here!
So I say: <u>All SKUs of Visual Studio should be free</u>.The goal should be to get
Visual Studio out to everyone, for free. I know that we have Express versions of these
products, and for the most part, they are very capable, but I mean the real deal,
Visual Studio Ultimate.
</p>
        <p>
Now I know what you are thinking: Steve, have you gone soft on me? 
</p>
        <p>
Of course not.  I am still a disciple of <a href="http://en.wikipedia.org/wiki/Milton_Friedman">Milton
Friedman</a> and a firm believer of free markets and economic incentives. But that
does not mean you have to actually sell something to make money on it. I am thinking
of Visual Studio 2.0. 
</p>
        <p>
For example, there are <a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx#compare">four
versions of Visual Studio</a> as far as I can tell. (And the fact that I have no idea
is a problem.) There are the free express versions, Professional, Premium, and (the
new SKU) Ultimate. 
</p>
        <p>
          <a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx#compare">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/VisualStudio2010shouldbefree_11881/image_3.png" width="772" height="193" />
          </a>
        </p>
        <p>
Microsoft should do away with all versions and give away Ultimate (without MSDN) to
anyone who wants it. My mom could go and download it if she wanted to. Just have to
provide some demographic information and have a Live ID.
</p>
        <p>
The startup page in Visual Studio would be ad supported (and you can’t make it go
away, so you will see it each time you load Visual Studio.)  I could see <a href="http://www.telerik.com">Telerik</a> or
our competitors wanting to sponsor that page-but not in a “pay us a million dollars
model”, rather as a pay per conversion model. Basically Telerik and our competitors
would pay a small fee to be on the startup page and be able to stream ads to the developers
and each Telerik license sold, Microsoft takes a cut.  Note to Microsoft, since
this was my idea, can Telerik have an exclusive on that page? :) 
</p>
        <p>
In addition, in exchange for the free Visual Studio, Microsoft will get anonymous
data from the developers. What country you are in, the specs of the developer machine,
installation experience, etc. Also how many projects were started in C# v VB v F#,
etc. Silverlight v Web, etc. Imagine if Microsoft knew all of this data!! I want to
know how many lines of C# code in Brazil were written for Windows Forms last week. 
</p>
        <p>
Microsoft can then sell ad space based on your environment. Think about a C# developer
in Poland working mostly on Silverlight. On the startup page next time there are offers
(in Polish) for Silverlight tools, conferences, books, or even job offers. How much
would Dell pay to market to every developer in Australia with Visual Studio installed
on an “underpowered” machine? The vendor would only know who you are if you actually
clicked on the offer.
</p>
        <p>
Microsoft can also make money by using Visual Studio as a sales engine for MSDN. MSDN
does not really have a “sales force” and Visual Studio can be a “loss leader” for
MSDN. 
</p>
        <p>
But MSDN’s business model would have to change as well. Why not have MSDN (not the
software part) evolve into a Visual Studio based Facebook/Linkedin social network
for developers. You can only get into your “MSDNFacebook” via Visual Studio. When
you are coding, Visual Studio can automatically update your status (Stephen Forte
is currently breaking the build….) Imagine hitting F1 and be brought to a MSDN forum
search on that line of code as one option. Every .NET developer in the world would
be a member of this social network! Want to find a user group? No problem! Imagine
the collaboration opportunities. A whole new world of revenue opportunities would
open up to Microsoft, including an IPO of MSDNFacebook! :)
</p>
        <p>
In addition, the MSDN software pricing model would change. Microsoft can sell fractional
MSDN licenses and specialize MSDN for local markets and different developer types.
Maybe you only want MSDN for Web Development. MSDN is expensive since it includes
big things like Windows Server and Exchange, etc. (I have never installed Exchange,
nor will I ever do so.)  Maybe you can have MSDN options where that is excluded.
Kind of like a menu where you customize just want you want and pay only for what you
use. Sell more with less. (Sound familiar?)
</p>
        <p>
Of course if you want the ads and the anonymous data collection turned off, you can
pay an annual fee. If your employer is paying that annual fee, they can opt out of
certain content, such as a job offer coming your way, etc.
</p>
        <p>
Visual Studio 2.0 would be awesome. Developers get free software and more collaboration,
vendors get to tap into the entire ecosystem, and Microsoft makes more money while
collecting a tremendous amount of metrics, metrics that will drive new features, service
packs, etc. 
</p>
        <p>
Maybe this will be one of the great announcements next week at the PDC……..
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8393729e-c6bf-4f50-b239-caca3612a2ca" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/Visual+Studio+2010" rel="tag">Visual Studio
2010</a>,<a href="http://technorati.com/tags/The+New+Economy" rel="tag">The New Economy</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=21936d4c-adad-454e-947a-6f3371bcdeb8" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/guzSR7WW78Y" height="1" width="1" /></body>
      <title>Visual Studio 2010 should be free&amp;hellip;..</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,21936d4c-adad-454e-947a-6f3371bcdeb8.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/guzSR7WW78Y/PermaLink,guid,21936d4c-adad-454e-947a-6f3371bcdeb8.aspx</link>
      <pubDate>Thu, 05 Nov 2009 11:56:41 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,21936d4c-adad-454e-947a-6f3371bcdeb8.aspx";digg_title = "Visual Studio 2010 should be free…..";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
I am in Hong Kong speaking at the &lt;a href="http://www.hkcs.org.hk/hkicc2009/conference_programme.html"&gt;Hong
Kong International Computer Conference&lt;/a&gt;. It is a great conference, it focuses on
IT as a driver for innovation and economic transformation. I was lucky enough to be
doing one of the keynote presentations on how technology is so disruptive and how
cloud computing changes entrepreneurship. In my talk I mention &lt;a href="http://www.kurzweilai.net/articles/art0134.html?printable=1"&gt;Ray
Kurzweil’s Abstraction of Moore's Law&lt;/a&gt;, which can be summarized as saying that
the next 20 years will see as much technological innovation as the past 100.
&lt;/p&gt;
&lt;p&gt;
I represented Microsoft Hong Kong in this talk, and after the speech lots of people
came up to me to chat. I got to talk to tons of folks at the conference: I got to
talk to students and professors at &lt;a href="http://www.hku.hk/"&gt;Hong Kong University&lt;/a&gt;,
the folks from &lt;a href="http://laptop.org/en/"&gt;One Laptop per Child&lt;/a&gt;, entrepreneurs
(including a &lt;a href="http://www.intuitiveautomata.com/"&gt;dude building some amazing
robotics&lt;/a&gt;), people form &lt;a href="http://www.hkesd.org/"&gt;NGOs&lt;/a&gt;, and local software
developers. We got to talking about how the new technology reality has drastically
changed business models. Think about digital media, the music industry has changed
forever, old business models just don’t work anymore.
&lt;/p&gt;
&lt;p&gt;
This got me thinking. Microsoft recently announced a great offer for &lt;a href="http://www.microsoft.com/presspass/press/2009/oct09/10-19VSFinalStretchPR.mspx"&gt;Visual
Studio Ultimate&lt;/a&gt; (yet another SKU). But the world has changed. Web 2.0 is here!
So I say: &lt;u&gt;All SKUs of Visual Studio should be free&lt;/u&gt;.The goal should be to get
Visual Studio out to everyone, for free. I know that we have Express versions of these
products, and for the most part, they are very capable, but I mean the real deal,
Visual Studio Ultimate.
&lt;/p&gt;
&lt;p&gt;
Now I know what you are thinking: Steve, have you gone soft on me? 
&lt;/p&gt;
&lt;p&gt;
Of course not.&amp;#160; I am still a disciple of &lt;a href="http://en.wikipedia.org/wiki/Milton_Friedman"&gt;Milton
Friedman&lt;/a&gt; and a firm believer of free markets and economic incentives. But that
does not mean you have to actually sell something to make money on it. I am thinking
of Visual Studio 2.0. 
&lt;/p&gt;
&lt;p&gt;
For example, there are &lt;a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx#compare"&gt;four
versions of Visual Studio&lt;/a&gt; as far as I can tell. (And the fact that I have no idea
is a problem.) There are the free express versions, Professional, Premium, and (the
new SKU) Ultimate. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.microsoft.com/visualstudio/en-us/products/2010/default.mspx#compare"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/VisualStudio2010shouldbefree_11881/image_3.png" width="772" height="193" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Microsoft should do away with all versions and give away Ultimate (without MSDN) to
anyone who wants it. My mom could go and download it if she wanted to. Just have to
provide some demographic information and have a Live ID.
&lt;/p&gt;
&lt;p&gt;
The startup page in Visual Studio would be ad supported (and you can’t make it go
away, so you will see it each time you load Visual Studio.)&amp;#160; I could see &lt;a href="http://www.telerik.com"&gt;Telerik&lt;/a&gt; or
our competitors wanting to sponsor that page-but not in a “pay us a million dollars
model”, rather as a pay per conversion model. Basically Telerik and our competitors
would pay a small fee to be on the startup page and be able to stream ads to the developers
and each Telerik license sold, Microsoft takes a cut.&amp;#160; Note to Microsoft, since
this was my idea, can Telerik have an exclusive on that page? :) 
&lt;/p&gt;
&lt;p&gt;
In addition, in exchange for the free Visual Studio, Microsoft will get anonymous
data from the developers. What country you are in, the specs of the developer machine,
installation experience, etc. Also how many projects were started in C# v VB v F#,
etc. Silverlight v Web, etc. Imagine if Microsoft knew all of this data!! I want to
know how many lines of C# code in Brazil were written for Windows Forms last week. 
&lt;/p&gt;
&lt;p&gt;
Microsoft can then sell ad space based on your environment. Think about a C# developer
in Poland working mostly on Silverlight. On the startup page next time there are offers
(in Polish) for Silverlight tools, conferences, books, or even job offers. How much
would Dell pay to market to every developer in Australia with Visual Studio installed
on an “underpowered” machine? The vendor would only know who you are if you actually
clicked on the offer.
&lt;/p&gt;
&lt;p&gt;
Microsoft can also make money by using Visual Studio as a sales engine for MSDN. MSDN
does not really have a “sales force” and Visual Studio can be a “loss leader” for
MSDN. 
&lt;/p&gt;
&lt;p&gt;
But MSDN’s business model would have to change as well. Why not have MSDN (not the
software part) evolve into a Visual Studio based Facebook/Linkedin social network
for developers. You can only get into your “MSDNFacebook” via Visual Studio. When
you are coding, Visual Studio can automatically update your status (Stephen Forte
is currently breaking the build….) Imagine hitting F1 and be brought to a MSDN forum
search on that line of code as one option. Every .NET developer in the world would
be a member of this social network! Want to find a user group? No problem! Imagine
the collaboration opportunities. A whole new world of revenue opportunities would
open up to Microsoft, including an IPO of MSDNFacebook! :)
&lt;/p&gt;
&lt;p&gt;
In addition, the MSDN software pricing model would change. Microsoft can sell fractional
MSDN licenses and specialize MSDN for local markets and different developer types.
Maybe you only want MSDN for Web Development. MSDN is expensive since it includes
big things like Windows Server and Exchange, etc. (I have never installed Exchange,
nor will I ever do so.)&amp;#160; Maybe you can have MSDN options where that is excluded.
Kind of like a menu where you customize just want you want and pay only for what you
use. Sell more with less. (Sound familiar?)
&lt;/p&gt;
&lt;p&gt;
Of course if you want the ads and the anonymous data collection turned off, you can
pay an annual fee. If your employer is paying that annual fee, they can opt out of
certain content, such as a job offer coming your way, etc.
&lt;/p&gt;
&lt;p&gt;
Visual Studio 2.0 would be awesome. Developers get free software and more collaboration,
vendors get to tap into the entire ecosystem, and Microsoft makes more money while
collecting a tremendous amount of metrics, metrics that will drive new features, service
packs, etc. 
&lt;/p&gt;
&lt;p&gt;
Maybe this will be one of the great announcements next week at the PDC……..
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:8393729e-c6bf-4f50-b239-caca3612a2ca" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/Visual+Studio+2010" rel="tag"&gt;Visual Studio
2010&lt;/a&gt;,&lt;a href="http://technorati.com/tags/The+New+Economy" rel="tag"&gt;The New Economy&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=21936d4c-adad-454e-947a-6f3371bcdeb8" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,21936d4c-adad-454e-947a-6f3371bcdeb8.aspx</comments>
      <category>Speaking</category>
      <category>Web 2.5</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,21936d4c-adad-454e-947a-6f3371bcdeb8.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=21d47449-e903-4f0b-909a-a1982780625d</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,21d47449-e903-4f0b-909a-a1982780625d.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,21d47449-e903-4f0b-909a-a1982780625d.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=21d47449-e903-4f0b-909a-a1982780625d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,21d47449-e903-4f0b-909a-a1982780625d.aspx";digg_title = "Speaking tomorrow at the Hong Kong International Computer Conference";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
Tomorrow I will be speaking at the 2009 edition of the <a href="http://www.hkcs.org.hk/hkicc2009/conference_programme.html">Hong
Kong International Computer Conference</a>. This year’s theme is on Value Creation
and Economic Transformation via IT. When they asked me to put together a session,
I jumped on the idea of how Cloud Computing has changed the economics of start-ups
and entrepreneurship.  
</p>
        <p>
I started <a href="http://www.wantedtech.com/">Corzen</a>, my last company, in 2002.
We got started for around $250,000. About $75,000 of that was on building out a data
center. I am a software guy, so this also took a lot of my time. In 2010, I can have
more processing power, more storage, and more free time for around $99 a month from <a href="http://www.microsoft.com/windowsazure/">Windows
Azure</a> or <a href="http://aws.amazon.com/ec2/">Amazon EC2</a>. Think about what
this will mean, it will be much easier to start a new business in the future. 
</p>
        <p>
The implications of this are staggering. The late 90s was always considered the golden
age of start-ups since funding was so “easy” in the .com boom. Now you can start your
own business for less than $20,000! We’ll see a ton of new businesses pop up in all
industries. Since you won’t need investment to get started and most entrepreneurs
will use their own money, the start-ups will have tons of passion. 
</p>
        <p>
Innovation will take a great leap forward in the next decade. Cloud Computing will
lead the way.
</p>
        <p>
          <a href="http://www.hkcs.org.hk/hkicc2009/conference_programme.html">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/SpeakingtomorrowattheHongKongInternation_CE3A/image_3.png" width="493" height="114" />
          </a>
        </p>
        <p>
        </p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:86dcb328-a9a5-4dc8-a69d-0acfc3afd38e" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/Entrepreneurship" rel="tag">Entrepreneurship</a>,<a href="http://technorati.com/tags/Hong+Kong+International+Computer+Conference" rel="tag">Hong
Kong International Computer Conference</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=21d47449-e903-4f0b-909a-a1982780625d" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/hFaBXNALRpg" height="1" width="1" /></body>
      <title>Speaking tomorrow at the Hong Kong International Computer Conference</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,21d47449-e903-4f0b-909a-a1982780625d.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/hFaBXNALRpg/PermaLink,guid,21d47449-e903-4f0b-909a-a1982780625d.aspx</link>
      <pubDate>Wed, 04 Nov 2009 06:43:02 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,21d47449-e903-4f0b-909a-a1982780625d.aspx";digg_title = "Speaking tomorrow at the Hong Kong International Computer Conference";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
Tomorrow I will be speaking at the 2009 edition of the &lt;a href="http://www.hkcs.org.hk/hkicc2009/conference_programme.html"&gt;Hong
Kong International Computer Conference&lt;/a&gt;. This year’s theme is on Value Creation
and Economic Transformation via IT. When they asked me to put together a session,
I jumped on the idea of how Cloud Computing has changed the economics of start-ups
and entrepreneurship.&amp;#160; 
&lt;/p&gt;
&lt;p&gt;
I started &lt;a href="http://www.wantedtech.com/"&gt;Corzen&lt;/a&gt;, my last company, in 2002.
We got started for around $250,000. About $75,000 of that was on building out a data
center. I am a software guy, so this also took a lot of my time. In 2010, I can have
more processing power, more storage, and more free time for around $99 a month from &lt;a href="http://www.microsoft.com/windowsazure/"&gt;Windows
Azure&lt;/a&gt; or &lt;a href="http://aws.amazon.com/ec2/"&gt;Amazon EC2&lt;/a&gt;. Think about what
this will mean, it will be much easier to start a new business in the future. 
&lt;/p&gt;
&lt;p&gt;
The implications of this are staggering. The late 90s was always considered the golden
age of start-ups since funding was so “easy” in the .com boom. Now you can start your
own business for less than $20,000! We’ll see a ton of new businesses pop up in all
industries. Since you won’t need investment to get started and most entrepreneurs
will use their own money, the start-ups will have tons of passion. 
&lt;/p&gt;
&lt;p&gt;
Innovation will take a great leap forward in the next decade. Cloud Computing will
lead the way.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.hkcs.org.hk/hkicc2009/conference_programme.html"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/SpeakingtomorrowattheHongKongInternation_CE3A/image_3.png" width="493" height="114" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:86dcb328-a9a5-4dc8-a69d-0acfc3afd38e" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/Entrepreneurship" rel="tag"&gt;Entrepreneurship&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Hong+Kong+International+Computer+Conference" rel="tag"&gt;Hong
Kong International Computer Conference&lt;/a&gt;
&lt;/div&gt;
&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=21d47449-e903-4f0b-909a-a1982780625d" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,21d47449-e903-4f0b-909a-a1982780625d.aspx</comments>
      <category>Speaking</category>
      <category>Web 2.5</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,21d47449-e903-4f0b-909a-a1982780625d.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=3a085b0c-defa-4eea-88a4-09607696b0c9</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,3a085b0c-defa-4eea-88a4-09607696b0c9.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,3a085b0c-defa-4eea-88a4-09607696b0c9.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=3a085b0c-defa-4eea-88a4-09607696b0c9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,3a085b0c-defa-4eea-88a4-09607696b0c9.aspx";digg_title = "LINQ shortcut when using Silverlight and ADO .NET Data Services";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
I have a simple demo application that uses <a href="http://msdn.microsoft.com/en-us/data/bb931106.aspx">ADO.NET
Data Services</a> as a data service back end for a Silverlight application. 
My ADO.NET Data Service uses the Entity Framework to map the Northwind database tables
of Customers, Orders, and Order Details. Once the Silverlight applications sets a
service reference to the ADO.NET Data Service, you can use the client side LINQ libraries
to build your application. My application looks like this, it has a drop down filled
with customers, a grid with Order and a grid with Order Details. As you click on each
one, it will filter the rest. 
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/LINQshortcutwhenusingSil.NETDataServices_F28C/image_2.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/LINQshortcutwhenusingSil.NETDataServices_F28C/image_thumb.png" width="451" height="369" />
          </a>
        </p>
        <p>
The LINQ statement for the drop down looks something like this:
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="rem">//this uses the LINQ
to REST proxy (servicereference1)</span>
          </pre>
          <pre>
            <span class="lnum"> 2: </span>NorthwindEntities dat = <span class="kwrd">new</span> NorthwindEntities(</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>
            <span class="kwrd">new</span> Uri(<span class="str">"Northwind.svc"</span>,
UriKind.Relative));</pre>
          <pre>
            <span class="lnum"> 4: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 5: </span>
            <span class="rem">//linq query to get
customers in ComboBox</span>
          </pre>
          <pre>
            <span class="lnum"> 6: </span>var customers = from c <span class="kwrd">in</span> dat.Customers</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span> orderby c.CustomerID</pre>
          <pre>
            <span class="lnum"> 8: </span> select c;</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
 
</p>
        <p>
Pretty basic LINQ stuff. What I would like to do next is bind my drop down combobox
to customers. There is one catch, since we are in Silverlight, this processing has
to be done asynchronously, so that data binding code has to be done elseware. 
</p>
        <p>
There are a few ways to do this, the most straight forward it to set a delegate and
catch an event, etc. Another is to use a code block and catch the event right in the
same method. 
</p>
        <p>
While both of these solutions are fine, I don’t like them. I don’t like them because
they look funny and pollute my data access code with tons of async communication stuff.
Lastly, for each area where we have a LINQ statement, we have a lot of repetitive
similar looking code. Every bone in my body wants to make that generic and only call
it once.
</p>
        <p>
Enter the AsyncLINQManager class I wrote. Forget about the details of this class for
now, I will list it below in full. For now let’s show how to use the LINQ statement
with the helper. First you have to create an instance of the AsyncLINQManager and
then register an event. (No getting around the events!) You can do this in the page
load handler:
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="rem">//ref to the linq
manager</span>
          </pre>
          <pre>
            <span class="lnum"> 2: </span>alm = <span class="kwrd">new</span> AsyncLINQManager();</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>
            <span class="rem">//register an event
so we can do the databinding</span>
          </pre>
          <pre>
            <span class="lnum"> 4: </span>alm.OnEntityFetched += Page_OnEntityFetched;</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
Now your LINQ statement needs one more line of code. Here is the same LINQ statement
from above, passing customers to the AsyncLINQManager:
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="rem">//this uses the LINQ
to REST proxy (servicereference1)</span>
          </pre>
          <pre>
            <span class="lnum"> 2: </span>NorthwindEntities dat = <span class="kwrd">new</span> NorthwindEntities(</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>
            <span class="kwrd">new</span> Uri(<span class="str">"Northwind.svc"</span>,
UriKind.Relative));</pre>
          <pre>
            <span class="lnum"> 4: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 5: </span>
            <span class="rem">//linq query to get
customers in ComboBox</span>
          </pre>
          <pre>
            <span class="lnum"> 6: </span>var customers = from c <span class="kwrd">in</span> dat.Customers</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span> orderby c.CustomerID</pre>
          <pre>
            <span class="lnum"> 8: </span> select c;</pre>
          <pre class="alt">
            <span class="lnum"> 9: </span>
            <span class="rem">//call async functions
for the linq query</span>
          </pre>
          <pre>
            <span class="lnum"> 10: </span>alm.LinqAsync(customers);</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
        </p>
        <p>
Line 10 is the only new line of code. Now the LINQ manager will take care of all of
the async processing for us and we just have to put our data binding code in Page_OnEntityFetched()
shown here:
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="rem">//this event handler
will do the actual databinding</span>
          </pre>
          <pre>
            <span class="lnum"> 2: </span>
            <span class="kwrd">void</span> Page_OnEntityFetched(EntityEventArgument
args)</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>{</pre>
          <pre>
            <span class="lnum"> 4: </span>
            <span class="kwrd">switch</span> (args.TypeName) <span class="rem">//we
get this info from the event</span></pre>
          <pre class="alt">
            <span class="lnum"> 5: </span> {</pre>
          <pre>
            <span class="lnum"> 6: </span>
            <span class="kwrd">case</span>
            <span class="str">"Customers"</span>:</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span> CustomerCbo.ItemsSource = args.returnedList;</pre>
          <pre>
            <span class="lnum"> 8: </span>
            <span class="kwrd">break</span>;</pre>
          <pre class="alt">
            <span class="lnum"> 9: </span>
            <span class="kwrd">case</span>
            <span class="str">"Orders"</span>:</pre>
          <pre>
            <span class="lnum"> 10: </span> dg.ItemsSource=args.returnedList;</pre>
          <pre class="alt">
            <span class="lnum"> 11: </span>
            <span class="kwrd">break</span>;</pre>
          <pre>
            <span class="lnum"> 12: </span>
            <span class="kwrd">case</span>
            <span class="str">"Order_Details"</span>:</pre>
          <pre class="alt">
            <span class="lnum"> 13: </span> dg_Details.ItemsSource = args.returnedList;</pre>
          <pre>
            <span class="lnum"> 14: </span>
            <span class="kwrd">break</span>;</pre>
          <pre class="alt">
            <span class="lnum"> 15: </span> </pre>
          <pre>
            <span class="lnum"> 16: </span> }</pre>
          <pre class="alt">
            <span class="lnum"> 17: </span>}</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
 
</p>
        <p>
You will notice that we do all of our data binding here, for all of our LINQ statements.
This is the value of the AsyncLINQManager, now all of my binding code is in the same
place. (I am sure that there will be some who disagree, but hey, build a better AsyncLINQManager
and blog about it and I will link to it. :) )
</p>
        <p>
So let’s take a look at the code to query the orders, you will notice that it will
call the same LINQ manager and then have to come back to Page_OnEntityFetched() to
do the binding:
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="rem">//orders</span>
          </pre>
          <pre>
            <span class="lnum"> 2: </span>
            <span class="kwrd">private</span>
            <span class="kwrd">void</span> AsyncBindOrdersCbo(<span class="kwrd">string</span> customerid)</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>{</pre>
          <pre>
            <span class="lnum"> 4: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 5: </span>
            <span class="rem">//this uses the LINQ
to REST proxy (servicereference1)</span>
          </pre>
          <pre>
            <span class="lnum"> 6: </span>NorthwindEntities dat = <span class="kwrd">new</span> NorthwindEntities(</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span>
            <span class="kwrd">new</span> Uri(<span class="str">"Northwind.svc"</span>,
UriKind.Relative));</pre>
          <pre>
            <span class="lnum"> 8: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 9: </span>
            <span class="rem">//linq query to filter
the Orders in the grid</span>
          </pre>
          <pre>
            <span class="lnum"> 10: </span>var orders = from o <span class="kwrd">in</span> dat.Orders</pre>
          <pre class="alt">
            <span class="lnum"> 11: </span>
            <span class="kwrd">where</span> o.Customers.CustomerID
== customerid</pre>
          <pre>
            <span class="lnum"> 12: </span> orderby o.OrderDate</pre>
          <pre class="alt">
            <span class="lnum"> 13: </span> select o;</pre>
          <pre>
            <span class="lnum"> 14: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 15: </span> alm.LinqAsync(orders);</pre>
          <pre>
            <span class="lnum"> 16: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 17: </span>}</pre>
        </div>
        <p>
          <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        </p>
        <p>
What I really  like is that you can go ahead and write a simple LINQ statement
like you are use to, pass the result to the AsyncLINQManager for processing and then
just have one event handler take care of all of your data binding. To me, your code
is more clean and your developers can code the LINQ statements almost like normal
(minus that one extra line of code) and forget about all of the async stuff. 
</p>
        <p>
The code for the AsyncLINQManager is here. All it is doing is sending out the async
request, catching it, and then returning an IList and object name in the event args. 
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="kwrd">using</span> System;</pre>
          <pre>
            <span class="lnum"> 2: </span>
            <span class="kwrd">using</span> System.Linq;<span class="rem">//for
IQueryable</span></pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>
            <span class="kwrd">using</span> System.Data.Services.Client;<span class="rem">//for
DataServiceQuery</span></pre>
          <pre>
            <span class="lnum"> 4: </span>
            <span class="kwrd">using</span> System.Collections;<span class="rem">//for
ILIST</span></pre>
          <pre class="alt">
            <span class="lnum"> 5: </span> </pre>
          <pre>
            <span class="lnum"> 6: </span>
            <span class="kwrd">namespace</span> LinqUtilities</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span>{</pre>
          <pre>
            <span class="lnum"> 8: </span>
            <span class="rem">//ASYNC Linq stuff</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 9: </span>
            <span class="kwrd">public</span>
            <span class="kwrd">class</span> AsyncLINQManager</pre>
          <pre>
            <span class="lnum"> 10: </span> {</pre>
          <pre class="alt">
            <span class="lnum"> 11: </span>
            <span class="rem">//see the EntityEventArgument
class below for the event args</span>
          </pre>
          <pre>
            <span class="lnum"> 12: </span>
            <span class="kwrd">public</span>
            <span class="kwrd">delegate</span>
            <span class="kwrd">void</span> EntityFetchCompleted(EntityEventArgument
args);</pre>
          <pre class="alt">
            <span class="lnum"> 13: </span>
            <span class="rem">//developer must
register this event in the UI code to catch the IList</span>
          </pre>
          <pre>
            <span class="lnum"> 14: </span>
            <span class="kwrd">public</span>
            <span class="kwrd">event</span> EntityFetchCompleted
OnEntityFetched;</pre>
          <pre class="alt">
            <span class="lnum"> 15: </span> </pre>
          <pre>
            <span class="lnum"> 16: </span>
            <span class="rem">//pass in linq query object
for execution</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 17: </span>
            <span class="kwrd">public</span>
            <span class="kwrd">void</span> LinqAsync&lt;T&gt;(IQueryable&lt;T&gt;
qry)</pre>
          <pre>
            <span class="lnum"> 18: </span> {</pre>
          <pre class="alt">
            <span class="lnum"> 19: </span>
            <span class="rem">//generic async
call to start the linq query</span>
          </pre>
          <pre>
            <span class="lnum"> 20: </span> DataServiceQuery&lt;T&gt; dsq = (DataServiceQuery&lt;T&gt;)qry;</pre>
          <pre class="alt">
            <span class="lnum"> 21: </span>
            <span class="rem">//Call the code
async and assign OnFetchComplete to handle the result</span>
          </pre>
          <pre>
            <span class="lnum"> 22: </span> dsq.BeginExecute(OnFetchComplete&lt;T&gt;, dsq);</pre>
          <pre class="alt">
            <span class="lnum"> 23: </span> }</pre>
          <pre>
            <span class="lnum"> 24: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 25: </span>
            <span class="rem">//method to handle
the async result</span>
          </pre>
          <pre>
            <span class="lnum"> 26: </span>
            <span class="kwrd">void</span> OnFetchComplete&lt;T&gt;(IAsyncResult
result)</pre>
          <pre class="alt">
            <span class="lnum"> 27: </span> {</pre>
          <pre>
            <span class="lnum"> 28: </span>
            <span class="rem">//catch the status of the async
call</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 29: </span> DataServiceQuery&lt;T&gt; dsq =(DataServiceQuery&lt;T&gt;)result.AsyncState;</pre>
          <pre>
            <span class="lnum"> 30: </span>
            <span class="rem">//if we are done, then stuff
the data into a untyped List</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 31: </span>
            <span class="kwrd">if</span> (OnEntityFetched
!= <span class="kwrd">null</span>)</pre>
          <pre>
            <span class="lnum"> 32: </span> {</pre>
          <pre class="alt">
            <span class="lnum"> 33: </span>
            <span class="rem">//delegate for
event</span>
          </pre>
          <pre>
            <span class="lnum"> 34: </span> OnEntityFetched(<span class="kwrd">new</span> EntityEventArgument</pre>
          <pre class="alt">
            <span class="lnum"> 35: </span> { returnedList = dsq.EndExecute(result).ToList()
});</pre>
          <pre>
            <span class="lnum"> 36: </span> }</pre>
          <pre class="alt">
            <span class="lnum"> 37: </span> }</pre>
          <pre>
            <span class="lnum"> 38: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 39: </span> }</pre>
          <pre>
            <span class="lnum"> 40: </span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 41: </span>
          </pre>
          <pre>
            <span class="lnum"> 42: </span>
            <span class="rem">//event args class for the
event on the client to </span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 43: </span>
            <span class="rem">//see what linq
query they are handling</span>
          </pre>
          <pre>
            <span class="lnum"> 44: </span>
            <span class="kwrd">public</span>
            <span class="kwrd">class</span> EntityEventArgument
: EventArgs</pre>
          <pre class="alt">
            <span class="lnum"> 45: </span> {</pre>
          <pre>
            <span class="lnum"> 46: </span>
            <span class="kwrd">public</span> IList returnedList
{ get; set; }</pre>
          <pre class="alt">
            <span class="lnum"> 47: </span>
            <span class="kwrd">public</span>
            <span class="kwrd">string</span> TypeName</pre>
          <pre>
            <span class="lnum"> 48: </span> {</pre>
          <pre class="alt">
            <span class="lnum"> 49: </span> get { <span class="kwrd">return</span> returnedList.Count
== 0 ? <span class="kwrd">string</span>.Empty : returnedList[0].GetType().Name; }</pre>
          <pre>
            <span class="lnum"> 50: </span> }</pre>
          <pre class="alt">
            <span class="lnum"> 51: </span> </pre>
          <pre>
            <span class="lnum"> 52: </span> }</pre>
          <pre class="alt">
            <span class="lnum"> 53: </span>}</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
You can download the sample code and the AsyncLINQManager code from my “DataAccess
Hacks and Shortcuts” <a href="http://www.stephenforte.net/PermaLink,guid,31b7ba81-1995-4b17-8a25-b7882fa5a75f.aspx">session
demos here</a>.
</p>
        <p>
Enjoy!
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:90c02b57-72bf-4129-be43-baeded175622" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/Silverlight" rel="tag">Silverlight</a>,<a href="http://technorati.com/tags/LINQ" rel="tag">LINQ</a>,<a href="http://technorati.com/tags/Astoria" rel="tag">Astoria</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=3a085b0c-defa-4eea-88a4-09607696b0c9" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/QCaKyPFhJEA" height="1" width="1" /></body>
      <title>LINQ shortcut when using Silverlight and ADO .NET Data Services</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,3a085b0c-defa-4eea-88a4-09607696b0c9.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/QCaKyPFhJEA/PermaLink,guid,3a085b0c-defa-4eea-88a4-09607696b0c9.aspx</link>
      <pubDate>Tue, 03 Nov 2009 09:42:33 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,3a085b0c-defa-4eea-88a4-09607696b0c9.aspx";digg_title = "LINQ shortcut when using Silverlight and ADO .NET Data Services";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
I have a simple demo application that uses &lt;a href="http://msdn.microsoft.com/en-us/data/bb931106.aspx"&gt;ADO.NET
Data Services&lt;/a&gt; as a data service back end for a Silverlight application.&amp;#160;
My ADO.NET Data Service uses the Entity Framework to map the Northwind database tables
of Customers, Orders, and Order Details. Once the Silverlight applications sets a
service reference to the ADO.NET Data Service, you can use the client side LINQ libraries
to build your application. My application looks like this, it has a drop down filled
with customers, a grid with Order and a grid with Order Details. As you click on each
one, it will filter the rest. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/LINQshortcutwhenusingSil.NETDataServices_F28C/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/LINQshortcutwhenusingSil.NETDataServices_F28C/image_thumb.png" width="451" height="369" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
The LINQ statement for the drop down looks something like this:
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="rem"&gt;//this uses the LINQ
to REST proxy (servicereference1)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;NorthwindEntities dat = &lt;span class="kwrd"&gt;new&lt;/span&gt; NorthwindEntities(&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;&amp;quot;Northwind.svc&amp;quot;&lt;/span&gt;,
UriKind.Relative));&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt;&lt;span class="rem"&gt;//linq query to get
customers in ComboBox&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt;var customers = from c &lt;span class="kwrd"&gt;in&lt;/span&gt; dat.Customers&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; orderby c.CustomerID&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; select c;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Pretty basic LINQ stuff. What I would like to do next is bind my drop down combobox
to customers. There is one catch, since we are in Silverlight, this processing has
to be done asynchronously, so that data binding code has to be done elseware. 
&lt;/p&gt;
&lt;p&gt;
There are a few ways to do this, the most straight forward it to set a delegate and
catch an event, etc. Another is to use a code block and catch the event right in the
same method. 
&lt;/p&gt;
&lt;p&gt;
While both of these solutions are fine, I don’t like them. I don’t like them because
they look funny and pollute my data access code with tons of async communication stuff.
Lastly, for each area where we have a LINQ statement, we have a lot of repetitive
similar looking code. Every bone in my body wants to make that generic and only call
it once.
&lt;/p&gt;
&lt;p&gt;
Enter the AsyncLINQManager class I wrote. Forget about the details of this class for
now, I will list it below in full. For now let’s show how to use the LINQ statement
with the helper. First you have to create an instance of the AsyncLINQManager and
then register an event. (No getting around the events!) You can do this in the page
load handler:
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="rem"&gt;//ref to the linq
manager&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;alm = &lt;span class="kwrd"&gt;new&lt;/span&gt; AsyncLINQManager();&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;&lt;span class="rem"&gt;//register an event
so we can do the databinding&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt;alm.OnEntityFetched += Page_OnEntityFetched;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
Now your LINQ statement needs one more line of code. Here is the same LINQ statement
from above, passing customers to the AsyncLINQManager:
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="rem"&gt;//this uses the LINQ
to REST proxy (servicereference1)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;NorthwindEntities dat = &lt;span class="kwrd"&gt;new&lt;/span&gt; NorthwindEntities(&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;&amp;quot;Northwind.svc&amp;quot;&lt;/span&gt;,
UriKind.Relative));&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt;&lt;span class="rem"&gt;//linq query to get
customers in ComboBox&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt;var customers = from c &lt;span class="kwrd"&gt;in&lt;/span&gt; dat.Customers&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; orderby c.CustomerID&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; select c;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt;&lt;span class="rem"&gt;//call async functions
for the linq query&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt;alm.LinqAsync(customers);&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Line 10 is the only new line of code. Now the LINQ manager will take care of all of
the async processing for us and we just have to put our data binding code in Page_OnEntityFetched()
shown here:
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="rem"&gt;//this event handler
will do the actual databinding&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;&lt;span class="kwrd"&gt;void&lt;/span&gt; Page_OnEntityFetched(EntityEventArgument
args)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt; &lt;span class="kwrd"&gt;switch&lt;/span&gt; (args.TypeName) &lt;span class="rem"&gt;//we
get this info from the event&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt; &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;Customers&amp;quot;&lt;/span&gt;:&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; CustomerCbo.ItemsSource = args.returnedList;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt; &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;Orders&amp;quot;&lt;/span&gt;:&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; dg.ItemsSource=args.returnedList;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt; &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; &lt;span class="kwrd"&gt;case&lt;/span&gt; &lt;span class="str"&gt;&amp;quot;Order_Details&amp;quot;&lt;/span&gt;:&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; dg_Details.ItemsSource = args.returnedList;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt; &lt;span class="kwrd"&gt;break&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 17: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
You will notice that we do all of our data binding here, for all of our LINQ statements.
This is the value of the AsyncLINQManager, now all of my binding code is in the same
place. (I am sure that there will be some who disagree, but hey, build a better AsyncLINQManager
and blog about it and I will link to it. :) )
&lt;/p&gt;
&lt;p&gt;
So let’s take a look at the code to query the orders, you will notice that it will
call the same LINQ manager and then have to come back to Page_OnEntityFetched() to
do the binding:
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="rem"&gt;//orders&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; AsyncBindOrdersCbo(&lt;span class="kwrd"&gt;string&lt;/span&gt; customerid)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt;&lt;span class="rem"&gt;//this uses the LINQ
to REST proxy (servicereference1)&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt;NorthwindEntities dat = &lt;span class="kwrd"&gt;new&lt;/span&gt; NorthwindEntities(&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(&lt;span class="str"&gt;&amp;quot;Northwind.svc&amp;quot;&lt;/span&gt;,
UriKind.Relative));&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt;&lt;span class="rem"&gt;//linq query to filter
the Orders in the grid&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt;var orders = from o &lt;span class="kwrd"&gt;in&lt;/span&gt; dat.Orders&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt; &lt;span class="kwrd"&gt;where&lt;/span&gt; o.Customers.CustomerID
== customerid&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; orderby o.OrderDate&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; select o;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt; alm.LinqAsync(orders);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 17: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;/p&gt;
&lt;p&gt;
What I really&amp;#160; like is that you can go ahead and write a simple LINQ statement
like you are use to, pass the result to the AsyncLINQManager for processing and then
just have one event handler take care of all of your data binding. To me, your code
is more clean and your developers can code the LINQ statements almost like normal
(minus that one extra line of code) and forget about all of the async stuff. 
&lt;/p&gt;
&lt;p&gt;
The code for the AsyncLINQManager is here. All it is doing is sending out the async
request, catching it, and then returning an IList and object name in the event args. 
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;span class="rem"&gt;//for
IQueryable&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Data.Services.Client;&lt;span class="rem"&gt;//for
DataServiceQuery&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections;&lt;span class="rem"&gt;//for
ILIST&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; LinqUtilities&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; &lt;span class="rem"&gt;//ASYNC Linq stuff&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AsyncLINQManager&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt; &lt;span class="rem"&gt;//see the EntityEventArgument
class below for the event args&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;delegate&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; EntityFetchCompleted(EntityEventArgument
args);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; &lt;span class="rem"&gt;//developer must
register this event in the UI code to catch the IList&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;event&lt;/span&gt; EntityFetchCompleted
OnEntityFetched;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt; &lt;span class="rem"&gt;//pass in linq query object
for execution&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 17: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; LinqAsync&amp;lt;T&amp;gt;(IQueryable&amp;lt;T&amp;gt;
qry)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 18: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 19: &lt;/span&gt; &lt;span class="rem"&gt;//generic async
call to start the linq query&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 20: &lt;/span&gt; DataServiceQuery&amp;lt;T&amp;gt; dsq = (DataServiceQuery&amp;lt;T&amp;gt;)qry;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 21: &lt;/span&gt; &lt;span class="rem"&gt;//Call the code
async and assign OnFetchComplete to handle the result&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 22: &lt;/span&gt; dsq.BeginExecute(OnFetchComplete&amp;lt;T&amp;gt;, dsq);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 23: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 24: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 25: &lt;/span&gt; &lt;span class="rem"&gt;//method to handle
the async result&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 26: &lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnFetchComplete&amp;lt;T&amp;gt;(IAsyncResult
result)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 27: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 28: &lt;/span&gt; &lt;span class="rem"&gt;//catch the status of the async
call&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 29: &lt;/span&gt; DataServiceQuery&amp;lt;T&amp;gt; dsq =(DataServiceQuery&amp;lt;T&amp;gt;)result.AsyncState;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 30: &lt;/span&gt; &lt;span class="rem"&gt;//if we are done, then stuff
the data into a untyped List&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 31: &lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (OnEntityFetched
!= &lt;span class="kwrd"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 32: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 33: &lt;/span&gt; &lt;span class="rem"&gt;//delegate for
event&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 34: &lt;/span&gt; OnEntityFetched(&lt;span class="kwrd"&gt;new&lt;/span&gt; EntityEventArgument&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 35: &lt;/span&gt; { returnedList = dsq.EndExecute(result).ToList()
});&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 36: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 37: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 38: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 39: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 40: &lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 41: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 42: &lt;/span&gt; &lt;span class="rem"&gt;//event args class for the
event on the client to &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 43: &lt;/span&gt; &lt;span class="rem"&gt;//see what linq
query they are handling&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 44: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EntityEventArgument
: EventArgs&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 45: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 46: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; IList returnedList
{ get; set; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 47: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; TypeName&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 48: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 49: &lt;/span&gt; get { &lt;span class="kwrd"&gt;return&lt;/span&gt; returnedList.Count
== 0 ? &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty : returnedList[0].GetType().Name; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 50: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 51: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 52: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 53: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
You can download the sample code and the AsyncLINQManager code from my “DataAccess
Hacks and Shortcuts” &lt;a href="http://www.stephenforte.net/PermaLink,guid,31b7ba81-1995-4b17-8a25-b7882fa5a75f.aspx"&gt;session
demos here&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Enjoy!
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:90c02b57-72bf-4129-be43-baeded175622" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/LINQ" rel="tag"&gt;LINQ&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Astoria" rel="tag"&gt;Astoria&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=3a085b0c-defa-4eea-88a4-09607696b0c9" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,3a085b0c-defa-4eea-88a4-09607696b0c9.aspx</comments>
      <category>Data Services</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,3a085b0c-defa-4eea-88a4-09607696b0c9.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=d5967a42-df98-4c12-9604-d788928f4b41</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,d5967a42-df98-4c12-9604-d788928f4b41.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,d5967a42-df98-4c12-9604-d788928f4b41.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=d5967a42-df98-4c12-9604-d788928f4b41</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,d5967a42-df98-4c12-9604-d788928f4b41.aspx";digg_title = "Using WCF with SQL Azure and Telerik OpenAccess";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
Microsoft’s <a href="http://www.microsoft.com/windowsazure/sqlazure/">SQL Azure</a> database
offering has great 3rd party support. This week Telerik is <a href="http://blogs.telerik.com/q_releases/posts.aspx">releasing
its Q3 version</a> of its entire product line and the <a href="http://www.telerik.com/products/orm.aspx">OpenAccess
ORM</a> will have more robust and native support for SQL Azure over what is <a href="http://www.stephenforte.net/PermaLink,guid,a7d16ce5-33d4-475b-bb5a-32d38c2a99b4.aspx">currently
available</a>. I will expand on the <a href="http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx">example
I did last week</a> on connecting to SQL Azure by showing how to work with OpenAccess
entities via WCF in a Silverlight application. 
</p>
        <p>
The fist thing that you have to do is create a project for your data access layer
and connect to SQL Azure. I started a new class library and used the Enable Project
to use ORM wizard. This is where you can specify your SQL Azure user account and credentials.
I <a href="http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx">showed
how to do this last week</a>, so I will skip the steps here. (This is a new feature
of Q3, in the previous version of OpenAccess, you had to use the SQL Server provider,
now OpenAccess supports SQL Azure natively!)
</p>
        <p>
Next we have to create a project to contain our WCF service. What we have to do next
is point the <a href="http://www.telerik.com/community/labs/telerik-data-services-wizard.aspx">Telerik
Data Service Wizard</a> to the DAL project and have it automatically create the SVC
and CS files of our service for us.  The wizard will automatically create all
of the CRUD methods for our entities. (In this demo I only used Customers.) In case
you have not used the wizard yet, here is a walk through video on how to do that.
</p>
        <object width="400" height="300">
          <param name="allowfullscreen" value="true" />
          <param name="allowscriptaccess" value="always" />
          <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6239133&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" />
          <embed src="http://vimeo.com/moogaloop.swf?clip_id=6239133&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300">
          </embed>
        </object>
        <p>
          <a href="http://vimeo.com/6239133">Telerik OpenAccess WCF Wizard Part I</a> from <a href="http://vimeo.com/user2205649">Stephen
Forte</a> on <a href="http://vimeo.com">Vimeo</a>.
</p>
        <p>
Now we will have two projects, one for our DAL and one for our WCF service. Now, add
a Silverlight project and your solution should look like this, four projects: the
DAL project, the WCF service project, the Silverlight Web project and the Silverlight
project itself. 
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/UsingWCFwithSQLAzureandTelerikOpenAccess_EDED/image_2.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/UsingWCFwithSQLAzureandTelerikOpenAccess_EDED/image_thumb.png" width="237" height="496" />
          </a>
        </p>
        <p>
Next up we set a service reference to our WCF service and call the ReadCustomers method
to get a list of all the customers and bind it to a XAML grid. (Remember that this
being Silverlight, we have to do it all asynchronously.) We do this inside of a LoadData
method in our form. 
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="kwrd">private</span>
            <span class="kwrd">void</span> LoadData()</pre>
          <pre>
            <span class="lnum"> 2: </span>{</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>
            <span class="rem">//ref to our service
proxy</span>
          </pre>
          <pre>
            <span class="lnum"> 4: </span> SampleWCFServiceClient wcf = <span class="kwrd">new</span> SampleWCFServiceClient();</pre>
          <pre class="alt">
            <span class="lnum"> 5: </span>
            <span class="rem">//register the event
handler-can move this up if you want</span>
          </pre>
          <pre>
            <span class="lnum"> 6: </span> wcf.ReadCustomersCompleted += ReadCustomersCompleted;</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span>
            <span class="rem">//make an async
call to ReadCustomer method of our WCF service</span>
          </pre>
          <pre>
            <span class="lnum"> 8: </span>
            <span class="rem">//get only the first 100 records
(default)</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 9: </span> wcf.ReadCustomersAsync(0, 100);</pre>
          <pre>
            <span class="lnum"> 10: </span>}</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
The first thing that we do in the code above is create a reference to our WCF service
in line 4 and then register an event handler to catch the asynchronous completion
of the event on line 6. On line 9 we make the (asynchronous) call to ReadCustomers().
Since ReadCustomers() will process asynchronously, we will have to go to the ReadCustomersCompleted()
method to catch the event. Let’s look at that here:
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span> </pre>
          <pre>
            <span class="lnum"> 2: </span>
            <span class="kwrd">void</span> ReadCustomersCompleted(<span class="kwrd">object</span> sender,
ReadCustomersCompletedEventArgs e)</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>{</pre>
          <pre>
            <span class="lnum"> 4: </span>
            <span class="rem">//if the filter is set use a
LINQ statement</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 5: </span>
            <span class="rem">//this can also
be done on the server via the service</span>
          </pre>
          <pre>
            <span class="lnum"> 6: </span>
            <span class="kwrd">if</span> (CheckFilter.IsChecked
== <span class="kwrd">true</span>)</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span> {</pre>
          <pre>
            <span class="lnum"> 8: </span> var filter = from c <span class="kwrd">in</span> e.Result</pre>
          <pre class="alt">
            <span class="lnum"> 9: </span>
            <span class="kwrd">where</span> c.Country
== <span class="str">"Germany"</span></pre>
          <pre>
            <span class="lnum"> 10: </span> select c;</pre>
          <pre class="alt">
            <span class="lnum"> 11: </span> </pre>
          <pre>
            <span class="lnum"> 12: </span> dataGridCustomers.ItemsSource = filter;</pre>
          <pre class="alt">
            <span class="lnum"> 13: </span> }</pre>
          <pre>
            <span class="lnum"> 14: </span>
            <span class="kwrd">else</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 15: </span> {</pre>
          <pre>
            <span class="lnum"> 16: </span> dataGridCustomers.ItemsSource = e.Result;</pre>
          <pre class="alt">
            <span class="lnum"> 17: </span> }</pre>
          <pre>
            <span class="lnum"> 18: </span>}</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
        </p>
        <p>
In ReadCustomersCompleted we are doing seeing if a checkbox is checked and if so,
we do some client side LINQ statements to filter on the client for only customers
in Germany. (This is a holdover from a demo I did at BASTA in Germany, of course you
should move your countries to a drop down list and then filter with a parameter! Better
yet, filter via the WCF service on the server!) If the checkbox is not checked, we
will just show all of the customers.
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/UsingWCFwithSQLAzureandTelerikOpenAccess_EDED/image_4.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/UsingWCFwithSQLAzureandTelerikOpenAccess_EDED/image_thumb_1.png" width="478" height="288" />
          </a>
        </p>
        <p>
If you want to edit a customer (or add, etc), the Silverlight grid allows you to do
this inside the grid itself. However, you have to make sure that all of your dirty
records are recorded so you only send back the dirty records to your backend WCF service.
(Why bother updating all of the records?) 
</p>
        <p>
Here is the code to build the collection on the Begin Edit of the grid. This code
just adds the current customer object into our custom collection (editedCustomers)
so we can loop through it later on if we are doing an update.
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="kwrd">void</span> dataGridCustomers_BeginningEdit(<span class="kwrd">object</span> sender,</pre>
          <pre>
            <span class="lnum"> 2: </span> DataGridBeginningEditEventArgs e)</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>{</pre>
          <pre>
            <span class="lnum"> 4: </span>
            <span class="rem">//build a list of Customer that
are dirty</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 5: </span> Customer customer = e.Row.DataContext <span class="kwrd">as</span> NorthwindWCFService.Customer;</pre>
          <pre>
            <span class="lnum"> 6: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 7: </span>
            <span class="kwrd">if</span> (!editedCustomers.Contains(customer))</pre>
          <pre>
            <span class="lnum"> 8: </span> {</pre>
          <pre class="alt">
            <span class="lnum"> 9: </span> editedCustomers.Add(customer);</pre>
          <pre>
            <span class="lnum"> 10: </span> }</pre>
          <pre class="alt">
            <span class="lnum"> 11: </span>}</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
 
</p>
        <p>
Now that we have our collection of dirty customers, we have to deal with the save
button. The code below is run when the user clicks on the save button, saving all
dirty records. Line 6 sets up the WCF service via the proxy and line 8 registers the
event. Lines 11-15 is a loop of all of the dirty customers. (I get them via the custom
collection editedCustomers shown above.) Inside of the loop on line 14 we make the
actual asynchronous call to the WCF service’s UpdateCustomer method passing in the
object and its correct ID. While the UpdateCusotmerCompleted event will fire (since
this method is called asynchronously) when the update is complete, we have nothing
really in that method except some cleanup of our custom collection and a message box
to the users that the update is complete. 
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="kwrd">void</span> ButtonSave_Click(<span class="kwrd">object</span> sender,
RoutedEventArgs e)</pre>
          <pre>
            <span class="lnum"> 2: </span>{</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>
          </pre>
          <pre>
            <span class="lnum"> 4: </span>
            <span class="rem">//the WCF service</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 5: </span>
            <span class="rem">//ref to our service
proxy</span>
          </pre>
          <pre>
            <span class="lnum"> 6: </span> SampleWCFServiceClient client = <span class="kwrd">new</span> SampleWCFServiceClient();</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span>
            <span class="rem">//register the event
handler-can move this up if you want</span>
          </pre>
          <pre>
            <span class="lnum"> 8: </span> client.UpdateCustomerCompleted += UpdateCustomerCompleted;</pre>
          <pre class="alt">
            <span class="lnum"> 9: </span> </pre>
          <pre>
            <span class="lnum"> 10: </span>
            <span class="rem">//save only the dirty customers</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 11: </span>
            <span class="kwrd">foreach</span> (NorthwindWCFService.Customer
customer <span class="kwrd">in</span> editedCustomers)</pre>
          <pre>
            <span class="lnum"> 12: </span> {</pre>
          <pre class="alt">
            <span class="lnum"> 13: </span>
            <span class="rem">//call the WCF
method async to update the customer</span>
          </pre>
          <pre>
            <span class="lnum"> 14: </span> client.UpdateCustomerAsync(customer.CustomerID.ToString(),
customer);</pre>
          <pre class="alt">
            <span class="lnum"> 15: </span> }</pre>
          <pre>
            <span class="lnum"> 16: </span> </pre>
          <pre class="alt">
            <span class="lnum"> 17: </span>}</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
        </p>
        <p>
That is all there is too it! An add or delete is done in the same way.
</p>
        <p>
Enjoy!
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e7c6e389-d2b3-4461-b823-124eb5d79097" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/SQL+Azure" rel="tag">SQL Azure</a>,<a href="http://technorati.com/tags/Telerik" rel="tag">Telerik</a>,<a href="http://technorati.com/tags/OpenAccess" rel="tag">OpenAccess</a>,<a href="http://technorati.com/tags/ORM" rel="tag">ORM</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=d5967a42-df98-4c12-9604-d788928f4b41" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/7hygH2XLFjI" height="1" width="1" /></body>
      <title>Using WCF with SQL Azure and Telerik OpenAccess</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,d5967a42-df98-4c12-9604-d788928f4b41.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/7hygH2XLFjI/PermaLink,guid,d5967a42-df98-4c12-9604-d788928f4b41.aspx</link>
      <pubDate>Mon, 02 Nov 2009 10:13:59 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,d5967a42-df98-4c12-9604-d788928f4b41.aspx";digg_title = "Using WCF with SQL Azure and Telerik OpenAccess";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
Microsoft’s &lt;a href="http://www.microsoft.com/windowsazure/sqlazure/"&gt;SQL Azure&lt;/a&gt; database
offering has great 3rd party support. This week Telerik is &lt;a href="http://blogs.telerik.com/q_releases/posts.aspx"&gt;releasing
its Q3 version&lt;/a&gt; of its entire product line and the &lt;a href="http://www.telerik.com/products/orm.aspx"&gt;OpenAccess
ORM&lt;/a&gt; will have more robust and native support for SQL Azure over what is &lt;a href="http://www.stephenforte.net/PermaLink,guid,a7d16ce5-33d4-475b-bb5a-32d38c2a99b4.aspx"&gt;currently
available&lt;/a&gt;. I will expand on the &lt;a href="http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx"&gt;example
I did last week&lt;/a&gt; on connecting to SQL Azure by showing how to work with OpenAccess
entities via WCF in a Silverlight application. 
&lt;/p&gt;
&lt;p&gt;
The fist thing that you have to do is create a project for your data access layer
and connect to SQL Azure. I started a new class library and used the Enable Project
to use ORM wizard. This is where you can specify your SQL Azure user account and credentials.
I &lt;a href="http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx"&gt;showed
how to do this last week&lt;/a&gt;, so I will skip the steps here. (This is a new feature
of Q3, in the previous version of OpenAccess, you had to use the SQL Server provider,
now OpenAccess supports SQL Azure natively!)
&lt;/p&gt;
&lt;p&gt;
Next we have to create a project to contain our WCF service. What we have to do next
is point the &lt;a href="http://www.telerik.com/community/labs/telerik-data-services-wizard.aspx"&gt;Telerik
Data Service Wizard&lt;/a&gt; to the DAL project and have it automatically create the SVC
and CS files of our service for us.&amp;#160; The wizard will automatically create all
of the CRUD methods for our entities. (In this demo I only used Customers.) In case
you have not used the wizard yet, here is a walk through video on how to do that.
&lt;/p&gt;
&lt;object width="400" height="300"&gt;
&lt;param name="allowfullscreen" value="true" /&gt;
&lt;param name="allowscriptaccess" value="always" /&gt;
&lt;param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6239133&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" /&gt;&lt;embed src="http://vimeo.com/moogaloop.swf?clip_id=6239133&amp;amp;server=vimeo.com&amp;amp;show_title=1&amp;amp;show_byline=1&amp;amp;show_portrait=0&amp;amp;color=&amp;amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;p&gt;
&lt;a href="http://vimeo.com/6239133"&gt;Telerik OpenAccess WCF Wizard Part I&lt;/a&gt; from &lt;a href="http://vimeo.com/user2205649"&gt;Stephen
Forte&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Now we will have two projects, one for our DAL and one for our WCF service. Now, add
a Silverlight project and your solution should look like this, four projects: the
DAL project, the WCF service project, the Silverlight Web project and the Silverlight
project itself. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/UsingWCFwithSQLAzureandTelerikOpenAccess_EDED/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/UsingWCFwithSQLAzureandTelerikOpenAccess_EDED/image_thumb.png" width="237" height="496" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Next up we set a service reference to our WCF service and call the ReadCustomers method
to get a list of all the customers and bind it to a XAML grid. (Remember that this
being Silverlight, we have to do it all asynchronously.) We do this inside of a LoadData
method in our form. 
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; LoadData()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt; &lt;span class="rem"&gt;//ref to our service
proxy&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt; SampleWCFServiceClient wcf = &lt;span class="kwrd"&gt;new&lt;/span&gt; SampleWCFServiceClient();&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt; &lt;span class="rem"&gt;//register the event
handler-can move this up if you want&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt; wcf.ReadCustomersCompleted += ReadCustomersCompleted;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; &lt;span class="rem"&gt;//make an async
call to ReadCustomer method of our WCF service&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; &lt;span class="rem"&gt;//get only the first 100 records
(default)&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt; wcf.ReadCustomersAsync(0, 100);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The first thing that we do in the code above is create a reference to our WCF service
in line 4 and then register an event handler to catch the asynchronous completion
of the event on line 6. On line 9 we make the (asynchronous) call to ReadCustomers().
Since ReadCustomers() will process asynchronously, we will have to go to the ReadCustomersCompleted()
method to catch the event. Let’s look at that here:
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;&lt;span class="kwrd"&gt;void&lt;/span&gt; ReadCustomersCompleted(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender,
ReadCustomersCompletedEventArgs e)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt; &lt;span class="rem"&gt;//if the filter is set use a
LINQ statement&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt; &lt;span class="rem"&gt;//this can also
be done on the server via the service&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (CheckFilter.IsChecked
== &lt;span class="kwrd"&gt;true&lt;/span&gt;)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; var filter = from c &lt;span class="kwrd"&gt;in&lt;/span&gt; e.Result&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt; &lt;span class="kwrd"&gt;where&lt;/span&gt; c.Country
== &lt;span class="str"&gt;&amp;quot;Germany&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; select c;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; dataGridCustomers.ItemsSource = filter;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt; &lt;span class="kwrd"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt; dataGridCustomers.ItemsSource = e.Result;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 17: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 18: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
In ReadCustomersCompleted we are doing seeing if a checkbox is checked and if so,
we do some client side LINQ statements to filter on the client for only customers
in Germany. (This is a holdover from a demo I did at BASTA in Germany, of course you
should move your countries to a drop down list and then filter with a parameter! Better
yet, filter via the WCF service on the server!) If the checkbox is not checked, we
will just show all of the customers.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/UsingWCFwithSQLAzureandTelerikOpenAccess_EDED/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/UsingWCFwithSQLAzureandTelerikOpenAccess_EDED/image_thumb_1.png" width="478" height="288" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
If you want to edit a customer (or add, etc), the Silverlight grid allows you to do
this inside the grid itself. However, you have to make sure that all of your dirty
records are recorded so you only send back the dirty records to your backend WCF service.
(Why bother updating all of the records?) 
&lt;/p&gt;
&lt;p&gt;
Here is the code to build the collection on the Begin Edit of the grid. This code
just adds the current customer object into our custom collection (editedCustomers)
so we can loop through it later on if we are doing an update.
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="kwrd"&gt;void&lt;/span&gt; dataGridCustomers_BeginningEdit(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender,&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt; DataGridBeginningEditEventArgs e)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt; &lt;span class="rem"&gt;//build a list of Customer that
are dirty&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt; Customer customer = e.Row.DataContext &lt;span class="kwrd"&gt;as&lt;/span&gt; NorthwindWCFService.Customer;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; &lt;span class="kwrd"&gt;if&lt;/span&gt; (!editedCustomers.Contains(customer))&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt; editedCustomers.Add(customer);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Now that we have our collection of dirty customers, we have to deal with the save
button. The code below is run when the user clicks on the save button, saving all
dirty records. Line 6 sets up the WCF service via the proxy and line 8 registers the
event. Lines 11-15 is a loop of all of the dirty customers. (I get them via the custom
collection editedCustomers shown above.) Inside of the loop on line 14 we make the
actual asynchronous call to the WCF service’s UpdateCustomer method passing in the
object and its correct ID. While the UpdateCusotmerCompleted event will fire (since
this method is called asynchronously) when the update is complete, we have nothing
really in that method except some cleanup of our custom collection and a message box
to the users that the update is complete. 
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="kwrd"&gt;void&lt;/span&gt; ButtonSave_Click(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender,
RoutedEventArgs e)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt; &lt;span class="rem"&gt;//the WCF service&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt; &lt;span class="rem"&gt;//ref to our service
proxy&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt; SampleWCFServiceClient client = &lt;span class="kwrd"&gt;new&lt;/span&gt; SampleWCFServiceClient();&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; &lt;span class="rem"&gt;//register the event
handler-can move this up if you want&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; client.UpdateCustomerCompleted += UpdateCustomerCompleted;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; &lt;span class="rem"&gt;//save only the dirty customers&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt; &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (NorthwindWCFService.Customer
customer &lt;span class="kwrd"&gt;in&lt;/span&gt; editedCustomers)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; &lt;span class="rem"&gt;//call the WCF
method async to update the customer&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt; client.UpdateCustomerAsync(customer.CustomerID.ToString(),
customer);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 17: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
That is all there is too it! An add or delete is done in the same way.
&lt;/p&gt;
&lt;p&gt;
Enjoy!
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e7c6e389-d2b3-4461-b823-124eb5d79097" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/SQL+Azure" rel="tag"&gt;SQL Azure&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Telerik" rel="tag"&gt;Telerik&lt;/a&gt;,&lt;a href="http://technorati.com/tags/OpenAccess" rel="tag"&gt;OpenAccess&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ORM" rel="tag"&gt;ORM&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=d5967a42-df98-4c12-9604-d788928f4b41" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,d5967a42-df98-4c12-9604-d788928f4b41.aspx</comments>
      <category>Azure</category>
      <category>Data Services</category>
      <category>Telerik</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,d5967a42-df98-4c12-9604-d788928f4b41.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=fea04c46-1fab-4195-a2e8-dde380941982</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,fea04c46-1fab-4195-a2e8-dde380941982.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,fea04c46-1fab-4195-a2e8-dde380941982.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=fea04c46-1fab-4195-a2e8-dde380941982</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,fea04c46-1fab-4195-a2e8-dde380941982.aspx";digg_title = "Speaking at TechDays in Hong Kong";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
I’ll be speaking this week at TechDays in Hong Kong. Doing a new session on TSQL Tips
and Tricks, a session on Silverlight, and of course the Daily Scrum (on Agile development
as well as scrum.)
</p>
        <p>
Hope to see you there.
</p>
        <p>
          <a href="http://www.microsoft.com/hk/technet/techdays2009/">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/SpeakingatTechDaysinHongKong_131BD/image_3.png" width="244" height="241" />
          </a>
        </p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e2bd276c-050f-449e-ab90-231c95a1345a" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/Tech+Days" rel="tag">Tech Days</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=fea04c46-1fab-4195-a2e8-dde380941982" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/KTWYcTyht2w" height="1" width="1" /></body>
      <title>Speaking at TechDays in Hong Kong</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,fea04c46-1fab-4195-a2e8-dde380941982.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/KTWYcTyht2w/PermaLink,guid,fea04c46-1fab-4195-a2e8-dde380941982.aspx</link>
      <pubDate>Sun, 01 Nov 2009 13:44:35 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,fea04c46-1fab-4195-a2e8-dde380941982.aspx";digg_title = "Speaking at TechDays in Hong Kong";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
I’ll be speaking this week at TechDays in Hong Kong. Doing a new session on TSQL Tips
and Tricks, a session on Silverlight, and of course the Daily Scrum (on Agile development
as well as scrum.)
&lt;/p&gt;
&lt;p&gt;
Hope to see you there.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.microsoft.com/hk/technet/techdays2009/"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/SpeakingatTechDaysinHongKong_131BD/image_3.png" width="244" height="241" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:e2bd276c-050f-449e-ab90-231c95a1345a" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/Tech+Days" rel="tag"&gt;Tech Days&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=fea04c46-1fab-4195-a2e8-dde380941982" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,fea04c46-1fab-4195-a2e8-dde380941982.aspx</comments>
      <category>Speaking</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,fea04c46-1fab-4195-a2e8-dde380941982.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=b4b60e8a-953b-4cc6-b517-2b30ca985a42</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=b4b60e8a-953b-4cc6-b517-2b30ca985a42</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx";digg_title = "Connecting to SQL Azure with Telerik OpenAccess";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
With the official release of <a href="http://www.microsoft.com/windowsazure/sqlazure/">SQL
Azure</a> less than three weeks away, we are starting to see mainstream vendor support
for SQL Azure. <a href="http://www.telerik.com/products/orm.aspx">Telerik’s OpenAccess
ORM</a> is no exception. With the <a href="http://blogs.telerik.com/q_releases/posts.aspx">Q3
release</a> of OpenAccess next week, OpenAccess will have full support for SQL Azure,
going further than the <a href="http://www.stephenforte.net/PermaLink,guid,a7d16ce5-33d4-475b-bb5a-32d38c2a99b4.aspx">basic
support available today</a> that I demonstrated on my blog last month. Full wizard
support, forward and reverse mapping, and of course data services support via the <a href="http://www.telerik.com/community/labs/telerik-data-services-wizard.aspx">Telerik
Data Services Wizard</a>. Let’s take a look at the basics here.
</p>
        <p>
          <strong>
            <u>Getting Started</u>
          </strong>
        </p>
        <p>
To get up and running and show the mapping and LINQ support, I will open Visual Studio
2008 (or 2010) and create a simple Console Application named OpenAccess.Azure.Demo.
The first step is to enable the project to use OpenAccess via the Enable Project Wizard.
As part of the wizard you need to specify which database you are going to connect
to. OpenAccess gives you many choices besides Microsoft SQL Server, and one of the
native choices is Microsoft SQL Azure. After you select SQL Azure, you will need to
provide your credentials (don’t forget to put the tcp: in front of your server name.)
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_4.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_thumb_1.png" width="535" height="396" />
          </a>
        </p>
        <p>
After you connect and finish the wizard, it is time to do some mapping.
</p>
        <p>
          <strong>
            <u>Mapping Database Objects</u>
          </strong>
        </p>
        <p>
To map some database objects to persistent classes, choose the Reverse Mapping wizard.
This will bring up the Reverse Mapping dialog where you can select which tables, views,
and stored procedures you want to map. In this case I will just select all of the
defaults and map all of Northwind (remember I <a href="http://www.stephenforte.net/PermaLink,guid,b59690a3-4fdb-4954-8b1b-e4c95bc5b9ad.aspx">migrated
Northwind</a> up to SQL Azure.) Now it is time to build a simple application.
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_6.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_thumb_2.png" width="544" height="479" />
          </a>
        </p>
        <p>
          <strong>
            <u>Working with SQL Azure Data</u>
          </strong>
        </p>
        <p>
Let’s write a LINQ statement to fetch all of the customers from one country and print
it out to the console window. First tings first, you have to put in a using statement
for OpenAccess:
</p>
        <pre class="csharpcode">
          <span class="kwrd">using</span> Telerik.OpenAccess;</pre>
        <p>
          <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        </p>
        <p>
Next we will create our LINQ statement. The LINQ statement will work like any LINQ
statement in OpenAccess, there is nothing special for SQL Azure, this LINQ statement
would work against SQL Server, MySQL, or Oracle. 
</p>
        <p>
        </p>
        <p>
        </p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="kwrd">static</span>
            <span class="kwrd">void</span> Main(<span class="kwrd">string</span>[]
args)</pre>
          <pre>
            <span class="lnum"> 2: </span>{</pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>
            <span class="rem">//data context</span>
          </pre>
          <pre>
            <span class="lnum"> 4: </span> IObjectScope dat = ObjectScopeProvider1.GetNewObjectScope();</pre>
          <pre class="alt">
            <span class="lnum"> 5: </span>
            <span class="rem">//LINQ Statement</span>
          </pre>
          <pre>
            <span class="lnum"> 6: </span> var result = from c <span class="kwrd">in</span> dat.Extent&lt;Customer&gt;()</pre>
          <pre class="alt">
            <span class="lnum"> 7: </span>
            <span class="kwrd">where</span> c.Country
== <span class="str">"Germany"</span></pre>
          <pre>
            <span class="lnum"> 8: </span> select c;</pre>
          <pre class="alt">
            <span class="lnum"> 9: </span>
            <span class="rem">//Print out the
company name</span>
          </pre>
          <pre>
            <span class="lnum"> 10: </span>
            <span class="kwrd">foreach</span> (var cust <span class="kwrd">in</span> result)</pre>
          <pre class="alt">
            <span class="lnum"> 11: </span> {</pre>
          <pre>
            <span class="lnum"> 12: </span> Console.WriteLine(<span class="str">"Company
Name: "</span> + cust.CompanyName);</pre>
          <pre class="alt">
            <span class="lnum"> 13: </span> }</pre>
          <pre>
            <span class="lnum"> 14: </span>
            <span class="rem">//keep the console window open</span>
          </pre>
          <pre class="alt">
            <span class="lnum"> 15: </span> Console.Read();</pre>
          <pre>
            <span class="lnum"> 16: </span>}</pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
        </p>
        <p>
The LINQ statement uses the data context, or IObjectScope in line 4, has a simple
LINQ statement on lines 6-8 to filter by the customers in Germany and then iterates
those customers and prints them out to the console window in lines 10-13. The result
is shown here:
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_8.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_thumb_3.png" width="494" height="243" />
          </a>
        </p>
        <p>
Pretty basic application, however, you can see that Telerik OpenAccess has full support
for SQL Azure. Next week I will show a more complete example. 
</p>
        <p>
Enjoy!
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4753a6af-9e43-472f-8943-a27fae5b2ec6" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/SQL+Azure" rel="tag">SQL Azure</a>,<a href="http://technorati.com/tags/Telerik" rel="tag">Telerik</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=b4b60e8a-953b-4cc6-b517-2b30ca985a42" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/VgWPavfkPok" height="1" width="1" /></body>
      <title>Connecting to SQL Azure with Telerik OpenAccess</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/VgWPavfkPok/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx</link>
      <pubDate>Fri, 30 Oct 2009 07:47:58 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx";digg_title = "Connecting to SQL Azure with Telerik OpenAccess";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
With the official release of &lt;a href="http://www.microsoft.com/windowsazure/sqlazure/"&gt;SQL
Azure&lt;/a&gt; less than three weeks away, we are starting to see mainstream vendor support
for SQL Azure. &lt;a href="http://www.telerik.com/products/orm.aspx"&gt;Telerik’s OpenAccess
ORM&lt;/a&gt; is no exception. With the &lt;a href="http://blogs.telerik.com/q_releases/posts.aspx"&gt;Q3
release&lt;/a&gt; of OpenAccess next week, OpenAccess will have full support for SQL Azure,
going further than the &lt;a href="http://www.stephenforte.net/PermaLink,guid,a7d16ce5-33d4-475b-bb5a-32d38c2a99b4.aspx"&gt;basic
support available today&lt;/a&gt; that I demonstrated on my blog last month. Full wizard
support, forward and reverse mapping, and of course data services support via the &lt;a href="http://www.telerik.com/community/labs/telerik-data-services-wizard.aspx"&gt;Telerik
Data Services Wizard&lt;/a&gt;. Let’s take a look at the basics here.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Getting Started&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
To get up and running and show the mapping and LINQ support, I will open Visual Studio
2008 (or 2010) and create a simple Console Application named OpenAccess.Azure.Demo.
The first step is to enable the project to use OpenAccess via the Enable Project Wizard.
As part of the wizard you need to specify which database you are going to connect
to. OpenAccess gives you many choices besides Microsoft SQL Server, and one of the
native choices is Microsoft SQL Azure. After you select SQL Azure, you will need to
provide your credentials (don’t forget to put the tcp: in front of your server name.)
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_thumb_1.png" width="535" height="396" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
After you connect and finish the wizard, it is time to do some mapping.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Mapping Database Objects&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
To map some database objects to persistent classes, choose the Reverse Mapping wizard.
This will bring up the Reverse Mapping dialog where you can select which tables, views,
and stored procedures you want to map. In this case I will just select all of the
defaults and map all of Northwind (remember I &lt;a href="http://www.stephenforte.net/PermaLink,guid,b59690a3-4fdb-4954-8b1b-e4c95bc5b9ad.aspx"&gt;migrated
Northwind&lt;/a&gt; up to SQL Azure.) Now it is time to build a simple application.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_thumb_2.png" width="544" height="479" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;u&gt;Working with SQL Azure Data&lt;/u&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Let’s write a LINQ statement to fetch all of the customers from one country and print
it out to the console window. First tings first, you have to put in a using statement
for OpenAccess:
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; Telerik.OpenAccess;&lt;/pre&gt;
&lt;p&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;/p&gt;
&lt;p&gt;
Next we will create our LINQ statement. The LINQ statement will work like any LINQ
statement in OpenAccess, there is nothing special for SQL Azure, this LINQ statement
would work against SQL Server, MySQL, or Oracle. 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Main(&lt;span class="kwrd"&gt;string&lt;/span&gt;[]
args)&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt; &lt;span class="rem"&gt;//data context&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt; IObjectScope dat = ObjectScopeProvider1.GetNewObjectScope();&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt; &lt;span class="rem"&gt;//LINQ Statement&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt; var result = from c &lt;span class="kwrd"&gt;in&lt;/span&gt; dat.Extent&amp;lt;Customer&amp;gt;()&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; &lt;span class="kwrd"&gt;where&lt;/span&gt; c.Country
== &lt;span class="str"&gt;&amp;quot;Germany&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; select c;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt; &lt;span class="rem"&gt;//Print out the
company name&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (var cust &lt;span class="kwrd"&gt;in&lt;/span&gt; result)&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; Console.WriteLine(&lt;span class="str"&gt;&amp;quot;Company
Name: &amp;quot;&lt;/span&gt; + cust.CompanyName);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt; &lt;span class="rem"&gt;//keep the console window open&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt; Console.Read();&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The LINQ statement uses the data context, or IObjectScope in line 4, has a simple
LINQ statement on lines 6-8 to filter by the customers in Germany and then iterates
those customers and prints them out to the console window in lines 10-13. The result
is shown here:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/ConnectingtoSQLAzurewithTelerikOpenAcces_DE1F/image_thumb_3.png" width="494" height="243" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Pretty basic application, however, you can see that Telerik OpenAccess has full support
for SQL Azure. Next week I will show a more complete example. 
&lt;/p&gt;
&lt;p&gt;
Enjoy!
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:4753a6af-9e43-472f-8943-a27fae5b2ec6" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/SQL+Azure" rel="tag"&gt;SQL Azure&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Telerik" rel="tag"&gt;Telerik&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=b4b60e8a-953b-4cc6-b517-2b30ca985a42" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx</comments>
      <category>Azure</category>
      <category>Data Services</category>
      <category>Telerik</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,b4b60e8a-953b-4cc6-b517-2b30ca985a42.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=d512e6d5-8516-4de2-b776-c3491ee547c0</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,d512e6d5-8516-4de2-b776-c3491ee547c0.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,d512e6d5-8516-4de2-b776-c3491ee547c0.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=d512e6d5-8516-4de2-b776-c3491ee547c0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,d512e6d5-8516-4de2-b776-c3491ee547c0.aspx";digg_title = "Life of an international conference speaker...";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
I am lucky to get to speak at many conferences in many different countries each year.
A lot of people ask what it is like to be an international confrence speaker. For
the most part, mind airport security and flight delays, it is the most fun you can
have and still be working. You get to hang out with your peers all over the world
and geek out. Then of course there is the partying…
</p>
        <p>
Sometimes your friends and colleagues want to keep partying well after the bar is
closed. At the last BASTA confrence in Germany last month, I retired around 2am well
after the we shut down the bar. My colleagues lead by fellow <a href="http://www.telerik.com">Telerik</a> employee
Peter Brunner and thinktecture’s  <a href="http://blogs.thinktecture.com/cweyer/">Christian
Weyer</a> aka the tall German, decided to keep drinking and raided their minibars.
When they exhausted their minibars, they came to my room. 
</p>
        <p>
Posing as housekeeping they come to my room in the middle of the night to wake me
up. They even turn around my do not disturb sign to “come on in.” I knew it was not
housekeeping, but I did not expect a party at my door. After I answer the door in
my underwear, I give them a tour of my “roomlet” as well as drink a beer before kicking
them out. Christian Weyer and I also play with my beer stein Oktoberfest hat that
I won at Oktoberfest-it is not meant to fit on a normal human’s head, but it does
fit Christian’s. 
</p>
        <p>
Daniel Walzenbach caught this all on film. 
</p>
        <p>
        </p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:4b2b1b59-ee22-4154-b52c-1380a2952485" class="wlWriterSmartContent">
          <div id="7986e4ac-0663-4d13-9bfa-13709d80e888" style="margin: 0px; padding: 0px; display: inline;">
            <div>
              <a href="http://www.youtube.com/watch?v=7QphjNZzBHY&amp;hl=en&amp;fs=1&amp;" target="_new">
                <img src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/Lifeofaninternationalconferencespeaker_D78C/videoec0d7fbf3e74.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('7986e4ac-0663-4d13-9bfa-13709d80e888'); downlevelDiv.innerHTML = &quot;&lt;div&gt;&lt;object width=\&quot;425\&quot; height=\&quot;355\&quot;&gt;&lt;param name=\&quot;movie\&quot; value=\&quot;http://www.youtube.com/v/7QphjNZzBHY&amp;hl=en&amp;fs=1&amp;&amp;hl=en\&quot;&gt;&lt;\/param&gt;&lt;embed src=\&quot;http://www.youtube.com/v/7QphjNZzBHY&amp;hl=en&amp;fs=1&amp;&amp;hl=en\&quot; type=\&quot;application/x-shockwave-flash\&quot; width=\&quot;425\&quot; height=\&quot;355\&quot;&gt;&lt;\/embed&gt;&lt;\/object&gt;&lt;\/div&gt;&quot;;" alt="" />
              </a>
            </div>
          </div>
        </div>
        <p>
 
</p>
        <p>
        </p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:91c51d2e-2278-4a87-965b-ad9498f52b52" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/BASTA" rel="tag">BASTA</a>,<a href="http://technorati.com/tags/Crazy+Germans" rel="tag">Crazy
Germans</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=d512e6d5-8516-4de2-b776-c3491ee547c0" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/vw9QtIIAT84" height="1" width="1" /></body>
      <title>Life of an international conference speaker...</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,d512e6d5-8516-4de2-b776-c3491ee547c0.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/vw9QtIIAT84/PermaLink,guid,d512e6d5-8516-4de2-b776-c3491ee547c0.aspx</link>
      <pubDate>Thu, 29 Oct 2009 07:19:35 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,d512e6d5-8516-4de2-b776-c3491ee547c0.aspx";digg_title = "Life of an international conference speaker...";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
I am lucky to get to speak at many conferences in many different countries each year.
A lot of people ask what it is like to be an international confrence speaker. For
the most part, mind airport security and flight delays, it is the most fun you can
have and still be working. You get to hang out with your peers all over the world
and geek out. Then of course there is the partying…
&lt;/p&gt;
&lt;p&gt;
Sometimes your friends and colleagues want to keep partying well after the bar is
closed. At the last BASTA confrence in Germany last month, I retired around 2am well
after the we shut down the bar. My colleagues lead by fellow &lt;a href="http://www.telerik.com"&gt;Telerik&lt;/a&gt; employee
Peter Brunner and thinktecture’s&amp;#160; &lt;a href="http://blogs.thinktecture.com/cweyer/"&gt;Christian
Weyer&lt;/a&gt; aka the tall German, decided to keep drinking and raided their minibars.
When they exhausted their minibars, they came to my room. 
&lt;/p&gt;
&lt;p&gt;
Posing as housekeeping they come to my room in the middle of the night to wake me
up. They even turn around my do not disturb sign to “come on in.” I knew it was not
housekeeping, but I did not expect a party at my door. After I answer the door in
my underwear, I give them a tour of my “roomlet” as well as drink a beer before kicking
them out. Christian Weyer and I also play with my beer stein Oktoberfest hat that
I won at Oktoberfest-it is not meant to fit on a normal human’s head, but it does
fit Christian’s. 
&lt;/p&gt;
&lt;p&gt;
Daniel Walzenbach caught this all on film. 
&lt;/p&gt;
&lt;p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:4b2b1b59-ee22-4154-b52c-1380a2952485" class="wlWriterSmartContent"&gt;
&lt;div id="7986e4ac-0663-4d13-9bfa-13709d80e888" style="margin: 0px; padding: 0px; display: inline;"&gt;
&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=7QphjNZzBHY&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" target="_new"&gt;&lt;img src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/Lifeofaninternationalconferencespeaker_D78C/videoec0d7fbf3e74.jpg" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('7986e4ac-0663-4d13-9bfa-13709d80e888'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/7QphjNZzBHY&amp;amp;hl=en&amp;amp;fs=1&amp;amp;&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/7QphjNZzBHY&amp;amp;hl=en&amp;amp;fs=1&amp;amp;&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:91c51d2e-2278-4a87-965b-ad9498f52b52" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/BASTA" rel="tag"&gt;BASTA&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Crazy+Germans" rel="tag"&gt;Crazy
Germans&lt;/a&gt;
&lt;/div&gt;
&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=d512e6d5-8516-4de2-b776-c3491ee547c0" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,d512e6d5-8516-4de2-b776-c3491ee547c0.aspx</comments>
      <category>Speaking</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,d512e6d5-8516-4de2-b776-c3491ee547c0.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.stephenforte.net/Trackback.aspx?guid=f1312255-6cee-4834-85e7-81fcca61582c</trackback:ping>
      <pingback:server>http://www.stephenforte.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.stephenforte.net/PermaLink,guid,f1312255-6cee-4834-85e7-81fcca61582c.aspx</pingback:target>
      <dc:creator>Stephen Forte</dc:creator>
      <wfw:comment>http://www.stephenforte.net/CommentView,guid,f1312255-6cee-4834-85e7-81fcca61582c.aspx</wfw:comment>
      <wfw:commentRss>http://www.stephenforte.net/SyndicationService.asmx/GetEntryCommentsRss?guid=f1312255-6cee-4834-85e7-81fcca61582c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.stephenforte.net/PermaLink,guid,f1312255-6cee-4834-85e7-81fcca61582c.aspx";digg_title = "Another Great SQL Azure Query Tool";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
The developer ecosystem is starting to rally around <a href="http://www.microsoft.com/windowsazure/sqlazure/">SQL
Azure</a>, and that is a healthy thing. I stumbled across this neat SQL Azure query
tool from Microguru today. It is called the Gem Query Tool for SQL Azure and you can <a href="http://www.microguru.com/gem/">download
it here</a>. It uses the .NET Framework 3.51 and is pretty lightweight. The cool thing
is that it has a community edition that is free to use. 
</p>
        <p>
According to Micoguru the tool:
</p>
        <p>
          <em> provides an intuitive user interface to connect to and work with SQL Azure databases.
Gem Query Tool supports execution of any DDL and DML script supported by SQL Azure.
To facilitate authoring of SQL queries, Gem Query Tool for SQL Azure displays tables
and columns in your database.</em>
        </p>
        <p>
I gave it a go today and it is simple to use. What stands out about this tool and
why I highlight it after I highlighted a few other tools is the database browse schema
feature. This is a basic feature that SQL Server’s own Management tool and the SQL
Azure web site both lack. Gem Query allows you to log into one database (my only complaint
is that there is not a “browse databases” feature) and select your tables or views.
Once you click on one you can view the schema in a nice grid:
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_2.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_thumb.png" width="473" height="354" />
          </a>
        </p>
        <p>
Access to this metadata is important after you have migrated some data since some
of the data types or defaults may not be what you expect. I also like that when you
click on a database object you have a “column” or “data” view. When you click on the
“data” tab, you will have the option to select the Top 100, Top 1000 (pretty convenient)
and All.
</p>
        <p>
          <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_6.png">
            <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_thumb_2.png" width="481" height="362" />
          </a>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
Gem Query has a very easy to use Query interface. While most other tools leave you
on your own to write SQL, Gem Query gives you three windows with the SQL keywords
supported by SQL Azure and a list of row returning database objects (tables, views,
etc..) When you select a SQL command, it will put it into the query window for you,
as it will for the objects. When you select an object you will also see the available
columns and click on those to build your query. I wrote this very simple query using
the builder:
</p>
        <p>
 
</p>
        <div class="csharpcode">
          <pre class="alt">
            <span class="lnum"> 1: </span>
            <span class="kwrd">SELECT</span> CustomerID,
ContactName, Country</pre>
          <pre>
            <span class="lnum"> 2: </span>
            <span class="kwrd">FROM</span> Customers </pre>
          <pre class="alt">
            <span class="lnum"> 3: </span>
            <span class="kwrd">ORDER</span>
            <span class="kwrd">BY</span> Country </pre>
        </div>
        <style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
        <p>
        </p>
        <a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_8.png">
          <img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_thumb_3.png" width="482" height="370" />
        </a>
        <p>
 
</p>
        <p>
Enjoy!
</p>
        <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:fb4ed84d-bb0d-4143-a108-fc03dd6d1df8" class="wlWriterSmartContent">Technorati
Tags: <a href="http://technorati.com/tags/SQL+Azure" rel="tag">SQL Azure</a></div>
        <img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=f1312255-6cee-4834-85e7-81fcca61582c" />
      <xhtml:img xmlns:xhtml="http://www.w3.org/1999/xhtml" src="http://feeds.feedburner.com/~r/StephenFortesBlog/~4/hd2tjiFZajk" height="1" width="1" /></body>
      <title>Another Great SQL Azure Query Tool</title>
      <guid isPermaLink="false">http://www.stephenforte.net/PermaLink,guid,f1312255-6cee-4834-85e7-81fcca61582c.aspx</guid>
      <link>http://feedproxy.google.com/~r/StephenFortesBlog/~3/hd2tjiFZajk/PermaLink,guid,f1312255-6cee-4834-85e7-81fcca61582c.aspx</link>
      <pubDate>Wed, 28 Oct 2009 10:53:55 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.stephenforte.net/PermaLink,guid,f1312255-6cee-4834-85e7-81fcca61582c.aspx";digg_title = "Another Great SQL Azure Query Tool";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
The developer ecosystem is starting to rally around &lt;a href="http://www.microsoft.com/windowsazure/sqlazure/"&gt;SQL
Azure&lt;/a&gt;, and that is a healthy thing. I stumbled across this neat SQL Azure query
tool from Microguru today. It is called the Gem Query Tool for SQL Azure and you can &lt;a href="http://www.microguru.com/gem/"&gt;download
it here&lt;/a&gt;. It uses the .NET Framework 3.51 and is pretty lightweight. The cool thing
is that it has a community edition that is free to use. 
&lt;/p&gt;
&lt;p&gt;
According to Micoguru the tool:
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt; provides an intuitive user interface to connect to and work with SQL Azure databases.
Gem Query Tool supports execution of any DDL and DML script supported by SQL Azure.
To facilitate authoring of SQL queries, Gem Query Tool for SQL Azure displays tables
and columns in your database.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
I gave it a go today and it is simple to use. What stands out about this tool and
why I highlight it after I highlighted a few other tools is the database browse schema
feature. This is a basic feature that SQL Server’s own Management tool and the SQL
Azure web site both lack. Gem Query allows you to log into one database (my only complaint
is that there is not a “browse databases” feature) and select your tables or views.
Once you click on one you can view the schema in a nice grid:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_2.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_thumb.png" width="473" height="354" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Access to this metadata is important after you have migrated some data since some
of the data types or defaults may not be what you expect. I also like that when you
click on a database object you have a “column” or “data” view. When you click on the
“data” tab, you will have the option to select the Top 100, Top 1000 (pretty convenient)
and All.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_thumb_2.png" width="481" height="362" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Gem Query has a very easy to use Query interface. While most other tools leave you
on your own to write SQL, Gem Query gives you three windows with the SQL keywords
supported by SQL Azure and a list of row returning database objects (tables, views,
etc..) When you select a SQL command, it will put it into the query window for you,
as it will for the objects. When you select an object you will also see the available
columns and click on those to build your query. I wrote this very simple query using
the builder:
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="kwrd"&gt;SELECT&lt;/span&gt; CustomerID,
ContactName, Country&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;&lt;span class="kwrd"&gt;FROM&lt;/span&gt; Customers &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;&lt;span class="kwrd"&gt;ORDER&lt;/span&gt; &lt;span class="kwrd"&gt;BY&lt;/span&gt; Country &lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;a href="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.stephenforte.net/content/binary/WindowsLiveWriter/AnotherGreatSQLAzureQueryTool_108AA/image_thumb_3.png" width="482" height="370" /&gt;&lt;/a&gt; 
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Enjoy!
&lt;/p&gt;
&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:fb4ed84d-bb0d-4143-a108-fc03dd6d1df8" class="wlWriterSmartContent"&gt;Technorati
Tags: &lt;a href="http://technorati.com/tags/SQL+Azure" rel="tag"&gt;SQL Azure&lt;/a&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://www.stephenforte.net/aggbug.ashx?id=f1312255-6cee-4834-85e7-81fcca61582c" /&gt;</description>
      <comments>http://www.stephenforte.net/CommentView,guid,f1312255-6cee-4834-85e7-81fcca61582c.aspx</comments>
      <category>Azure</category>
    <feedburner:origLink>http://www.stephenforte.net/PermaLink,guid,f1312255-6cee-4834-85e7-81fcca61582c.aspx</feedburner:origLink></item>
  </channel>
</rss>
