<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Scriptstar &#187; Silverlight</title>
	<atom:link href="http://www.scriptstar.co.uk/tag/silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.scriptstar.co.uk</link>
	<description></description>
	<lastBuildDate>Fri, 23 Jul 2010 22:41:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Silverlight Sample Application with SQL Azure</title>
		<link>http://www.scriptstar.co.uk/silverlight-sample-application-with-sql-azure/</link>
		<comments>http://www.scriptstar.co.uk/silverlight-sample-application-with-sql-azure/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 22:47:58 +0000</pubDate>
		<dc:creator>Narendra</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[RIA Services]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[SQL Azure]]></category>

		<guid isPermaLink="false">http://www.scriptstar.co.uk/?p=82</guid>
		<description><![CDATA[Updated : 30th Apr 2010 My favourite Author Matthew MacDonald is publishing a book on Silverlight 4.0. Please check here. I was trying some silverlight business application that Brad Abrams was describing in his blog and it is an amazing silverlight series. If you want to learn silverlight (not the graphic stuff, dev stuff) then [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scriptstar.co.uk%2Fsilverlight-sample-application-with-sql-azure%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scriptstar.co.uk%2Fsilverlight-sample-application-with-sql-azure%2F&amp;style=normal&amp;service=bit.ly&amp;service_api=scriptstar%3AR_991057c9b732a05f226e1bff49cdbf3a&amp;hashtags=RIA+Services,Silverlight,SQL+Azure&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><em><strong>Updated : 30th Apr 2010</strong></em></p>
<blockquote><p><em>My favourite Author Matthew MacDonald is publishing a book on Silverlight 4.0. Please check <a href="http://www.amazon.com/gp/product/1430229799?ie=UTF8&amp;tag=bestp0b-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430229799" target="_blank">here</a>.<br />
</em></p></blockquote>
<p>I was trying some silverlight business application that <a href="http://blogs.msdn.com/brada/archive/2009/10/27/index-for-business-apps-example-for-silverlight-3-rtm-and-net-ria-services-july-update.aspx" target="_blank">Brad Abrams</a> was describing in his blog and it is an amazing silverlight series. If you want to learn silverlight (not the graphic stuff, dev stuff) then you hang on there for a while.</p>
<p>I am very much interested to integrate Brad’s app with SQL AZURE and it is straight forward but with a slight twist. To try this application, you need to have <a href="http://www.microsoft.com/silverlight/resources/technical-resources/default.aspx" target="_blank">Silverlight developer tools</a> installed and to see this in cloud (SQL AZURE) you need to have a <a href="http://www.microsoft.com/windowsazure/sqlazure/" target="_blank">SQL Azure</a> CTP access.</p>
<p>I changed my database slightly because I struggle to open Brad’s database. Brad was using Super Employee database but I was using my own. Half of this article is lifted shamelessly from the Brad’s article. All I wanted to show you guys how easy it is to connect to SQL Azure. If you want to learn Silverlight and RIA stuff then he is the man.</p>
<p>Open you VS 2008</p>
<p><strong>File -&gt; New Project -&gt; Silverlight Business Applications</strong></p>
<div id="attachment_84" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/SilverlightBusinessApplication.JPG"><img class="size-full wp-image-84" title="SilverlightBusinessApplication" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/SilverlightBusinessApplication.JPG" alt="Choose project type" width="640" height="435" /></a><p class="wp-caption-text">Choose project type</p></div>
<p>Name the project <strong>SLSASampleAPP </strong></p>
<p>If you wondering what the name stands for then SL stands for Silverlight, SA stands for SQL Azure.</p>
<p>Once you done, it will create two projects. One is Silverlight front end which is <strong>SLSASampleApp </strong>and server side project <strong>SASLSampleAPP.Web</strong>.</p>
<p>Don’t confuse with the name <strong>‘SASLSampleAPP.Web’</strong>, this is not your Silverlight front end. The top one is the web front end.</p>
<div id="attachment_87" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/2.JPG"><img class="size-full wp-image-87" title="Solution explorer view" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/2.JPG" alt="Solution explorer view" width="640" height="493" /></a><p class="wp-caption-text">Solution explorer view</p></div>
<p>Just hit F5 and see the application. It should be fine. If you are getting debugging error then you haven’t installed Silverlight dev tools. You go and get them and install and restart your computer. When you come back, I may not be here; you just bookmark my blog now and restart.</p>
<p>Now you should see just like this.</p>
<div id="attachment_88" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/3.JPG"><img class="size-full wp-image-88" title="3" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/3.JPG" alt="Browse view" width="640" height="456" /></a><p class="wp-caption-text">Browse view</p></div>
<p>Create a Database in your local SQL Server named as <strong>‘SLSADb’</strong></p>
<p>I assume, you guys can create the above database manually. If not I am copying the code for you. Just copy/paste and run in your SSMS.  I am using full blown SQL Server 2005 Dev edition.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">USE</span> <span style="color: #66cc66;">&#91;</span>master<span style="color: #66cc66;">&#93;</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #808080; font-style: italic;">/****** Object:  Database [SLSADb]    Script Date: 11/12/2009 12:35:47 ******/</span>
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">ON</span>  <span style="color: #993333; font-weight: bold;">PRIMARY</span>
<span style="color: #66cc66;">&#40;</span> NAME <span style="color: #66cc66;">=</span> N<span style="color: #ff0000;">'SLSADb'</span><span style="color: #66cc66;">,</span> FILENAME <span style="color: #66cc66;">=</span> N<span style="color: #ff0000;">'C:<span style="color: #000099; font-weight: bold;">\P</span>rogram Files<span style="color: #000099; font-weight: bold;">\M</span>icrosoft SQL Server<span style="color: #000099; font-weight: bold;">\M</span>SSQL.1<span style="color: #000099; font-weight: bold;">\M</span>SSQL<span style="color: #000099; font-weight: bold;">\D</span>ATA<span style="color: #000099; font-weight: bold;">\S</span>LSADb.mdf'</span> <span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">SIZE</span> <span style="color: #66cc66;">=</span> 3072KB <span style="color: #66cc66;">,</span> MAXSIZE <span style="color: #66cc66;">=</span> UNLIMITED<span style="color: #66cc66;">,</span> FILEGROWTH <span style="color: #66cc66;">=</span> 1024KB <span style="color: #66cc66;">&#41;</span>
 LOG <span style="color: #993333; font-weight: bold;">ON</span>
<span style="color: #66cc66;">&#40;</span> NAME <span style="color: #66cc66;">=</span> N<span style="color: #ff0000;">'SLSADb_log'</span><span style="color: #66cc66;">,</span> FILENAME <span style="color: #66cc66;">=</span> N<span style="color: #ff0000;">'C:<span style="color: #000099; font-weight: bold;">\P</span>rogram Files<span style="color: #000099; font-weight: bold;">\M</span>icrosoft SQL Server<span style="color: #000099; font-weight: bold;">\M</span>SSQL.1<span style="color: #000099; font-weight: bold;">\M</span>SSQL<span style="color: #000099; font-weight: bold;">\D</span>ATA<span style="color: #000099; font-weight: bold;">\S</span>LSADb_log.ldf'</span> <span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">SIZE</span> <span style="color: #66cc66;">=</span> 1024KB <span style="color: #66cc66;">,</span> MAXSIZE <span style="color: #66cc66;">=</span> 2048GB <span style="color: #66cc66;">,</span> FILEGROWTH <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">10</span>%<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">EXEC</span> dbo<span style="color: #66cc66;">.</span>sp_dbcmptlevel @dbname<span style="color: #66cc66;">=</span>N<span style="color: #ff0000;">'SLSADb'</span><span style="color: #66cc66;">,</span> @new_cmptlevel<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">90</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">=</span> FULLTEXTSERVICEPROPERTY<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'IsFullTextInstalled'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">BEGIN</span>
<span style="color: #993333; font-weight: bold;">EXEC</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>sp_fulltext_database<span style="color: #66cc66;">&#93;</span> @action <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'disable'</span>
<span style="color: #993333; font-weight: bold;">END</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> ANSI_NULL_DEFAULT OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> ANSI_NULLS OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> ANSI_PADDING OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> ANSI_WARNINGS OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> ARITHABORT OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> AUTO_CLOSE OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> AUTO_CREATE_STATISTICS <span style="color: #993333; font-weight: bold;">ON</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> AUTO_SHRINK OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> AUTO_UPDATE_STATISTICS <span style="color: #993333; font-weight: bold;">ON</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> CURSOR_CLOSE_ON_COMMIT OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> CURSOR_DEFAULT  GLOBAL
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> CONCAT_NULL_YIELDS_NULL OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> NUMERIC_ROUNDABORT OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> QUOTED_IDENTIFIER OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> RECURSIVE_TRIGGERS OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span>  ENABLE_BROKER
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> AUTO_UPDATE_STATISTICS_ASYNC OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> DATE_CORRELATION_OPTIMIZATION OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> TRUSTWORTHY OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> ALLOW_SNAPSHOT_ISOLATION OFF
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> PARAMETERIZATION SIMPLE
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span>  READ_WRITE
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> RECOVERY <span style="color: #993333; font-weight: bold;">FULL</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span>  MULTI_USER
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> PAGE_VERIFY CHECKSUM
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">DATABASE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">SET</span> DB_CHAINING OFF</pre></div></div>

<p>Create a table <strong>Colleague </strong>in the SLSADb database.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">USE</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #808080; font-style: italic;">/****** Object:  Table [dbo].[Colleague]    Script Date: 11/12/2009 13:22:24 ******/</span>
<span style="color: #993333; font-weight: bold;">SET</span> ANSI_NULLS <span style="color: #993333; font-weight: bold;">ON</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">SET</span> QUOTED_IDENTIFIER <span style="color: #993333; font-weight: bold;">ON</span>
<span style="color: #993333; font-weight: bold;">GO</span>
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> <span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Colleague<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span>
	<span style="color: #66cc66;">&#91;</span>ID<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">IDENTITY</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>FirstName<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span>nvarchar<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>LastName<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span>nvarchar<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>JobTitle<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span>nvarchar<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>EmpNumber<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span>nvarchar<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>CostCentre<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span>nvarchar<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>Department<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span>nvarchar<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>LineManagerID<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">INT</span><span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>PhoneNumber<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span>nvarchar<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">25</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
	<span style="color: #66cc66;">&#91;</span>MobileNumber<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#91;</span>nvarchar<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">25</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>
 <span style="color: #993333; font-weight: bold;">CONSTRAINT</span> <span style="color: #66cc66;">&#91;</span>PK_Colleague<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span> CLUSTERED
<span style="color: #66cc66;">&#40;</span>
	<span style="color: #66cc66;">&#91;</span>ID<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">ASC</span>
<span style="color: #66cc66;">&#41;</span><span style="color: #993333; font-weight: bold;">WITH</span> <span style="color: #66cc66;">&#40;</span>PAD_INDEX  <span style="color: #66cc66;">=</span> OFF<span style="color: #66cc66;">,</span> STATISTICS_NORECOMPUTE  <span style="color: #66cc66;">=</span> OFF<span style="color: #66cc66;">,</span> IGNORE_DUP_KEY <span style="color: #66cc66;">=</span> OFF<span style="color: #66cc66;">,</span> ALLOW_ROW_LOCKS  <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">ON</span><span style="color: #66cc66;">,</span> ALLOW_PAGE_LOCKS  <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">ON</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">PRIMARY</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">ON</span> <span style="color: #66cc66;">&#91;</span><span style="color: #993333; font-weight: bold;">PRIMARY</span><span style="color: #66cc66;">&#93;</span></pre></div></div>

<p>Now insert couple of records into the table.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Colleague<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'FName1'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'LastName1'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Developer Lead'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'123456'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'D3455'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'I.T'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'012345 678 999'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'07712 345 678'</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Colleague<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'FName2'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'LastName2'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Manager'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'789654'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'D3455'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'I.T'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'012345 678 123'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'07712 345 111'</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Well done. We are half way through. Let me grab some coffee. You go and get one for you, you deserve it.</p>
<p>Common mate, where is SQL Azure. Wait.. it went for a coffee too.</p>
<p>Now back to VS2008. We need some way of talking to our Colleague table. Almost every business app talks to database at somepoint using some technology. Whether it is ADO.net, LINQ2SQL or EntityFramework. Let’s look at how to do this with .NET RIA Services. We will start out in the web project(SLSASampleApp.Web).</p>
<p>For this example I will use an Entity Framework data model, but RIA Services works great with any form of data from plain old CLR objects to an xml file, to web services to Linq to Sql.<br />
Right click on your server project (SLSASampleApp.Web)</p>
<p>select <strong>Add -&gt; New Item -&gt; ADO.NET Entity Data Model</strong></p>
<p>Name: <strong>SLSASampleApp.edmx</strong></p>
<div id="attachment_91" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/4.JPG"><img class="size-full wp-image-91" title="Add Entity framework" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/4.JPG" alt="Add Entity framework" width="640" height="400" /></a><p class="wp-caption-text">Add Entity framework</p></div>
<p>Do all the necessary steps with default names and select the colleague table.</p>
<div id="attachment_92" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/5.JPG"><img class="size-full wp-image-92" title="Colleagues table" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/5.JPG" alt="Colleagues table" width="640" height="452" /></a><p class="wp-caption-text">Colleagues table</p></div>
<p>Change the Entity Set name to Colleagues in the properties window. Save and Build the Solution.</p>
<p>These .NET RIA Services model your UI-tier application logic and encapsulate your access to various data sources from traditional relational data to POCO (plain old CLR objects) to cloud services such as Azure, S3, etc via REST, etc.  One of the great things about this is that you can move from on premises Sql Server to an Azure hosted data services without having to change any of your UI logic. Simply great.</p>
<p>It is piece of cake to create these .NET RIA services.</p>
<p>Right click on to the server project (SLSASampleApp.Web) Add -&gt; New Item<br />
select the new Domain Service class and name it <strong>SLSASampleAppDomainService.cs</strong></p>
<div id="attachment_93" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/6.JPG"><img class="size-full wp-image-93" title="Add new Domain Service" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/6.JPG" alt="Add new Domain Service" width="640" height="400" /></a><p class="wp-caption-text">Add new Domain Service</p></div>
<p>It opens up ‘Add New Domain Service class’ window. In the wizard, select your data source.  Notice here we could have chosen to use a Linq2Sql class, a POCO class, yada, yada.  Check all the checkboxes.</p>
<div id="attachment_94" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/8.JPG"><img class="size-full wp-image-94" title="Add new domain service class" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/8.JPG" alt="Add new domain service class" width="640" height="603" /></a><p class="wp-caption-text">Add new domain service class</p></div>
<p>In the <strong>SLSASampleAppDomainService.cs</strong> class we have stubs for all the CRUD method for accessing your data. Just go through this class. Now we are ready to rock.</p>
<p>Build the solution now.</p>
<p>Now, let’s switch the client side (SLSASampleApp).  Be sure to build the solution so you can access it from the client directly.  These projects are linked because we selected the “ASP.NET enable” in the new project wizard.</p>
<p>Go to Views -&gt; Home.xaml</p>
<p>Drag and drop a DataGrid from the toolbox somewhere near the end of the page. This is a Silverlight XAML control</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;</pre></div></div>

<p>Go to code behind (Home.xaml.cs)</p>
<p>Now we have to bring the domain service to the client side. So add a using statement on top.</p>
<p><strong>using SLSASampleApp.Web;</strong></p>
<p>By adding this, you can now access the client proxy for the server DomainServices locally.</p>
<p><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/9.JPG"><img class="aligncenter size-full wp-image-95" title="Add Service domain namespace" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/9.JPG" alt="Add Service domain namespace" width="640" height="400" /></a></p>
<p>Copy the below code and paste it in the Home under the IntializeComponent() method.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">var context <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> SLSASampleAppDomainContext<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
colleagueGrid<span style="color: #008000;">.</span><span style="color: #0000FF;">ItemsSource</span> <span style="color: #008000;">=</span> context<span style="color: #008000;">.</span><span style="color: #0000FF;">Colleagues</span><span style="color: #008000;">;</span>
context<span style="color: #008000;">.</span><span style="color: #0000FF;">Load</span><span style="color: #008000;">&#40;</span>context<span style="color: #008000;">.</span><span style="color: #0000FF;">GetColleaguesQuery</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>It should exactly look like this.</p>
<div id="attachment_96" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/10.JPG"><img class="size-full wp-image-96" title="Code" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/10.JPG" alt="Code" width="640" height="400" /></a><p class="wp-caption-text">Code</p></div>
<p>In line 1, we create our SLSASampleAppDomainContext. This is the client side of the SLSASampleAppDomainService.  Think SLSASampleAppDomainContext as a proxy class.</p>
<p>In line 2, we are data binding the grid to the Colleagues.</p>
<p>In line 3 we are loading the Colleagues, that class the GetColleagues () method we defined on the server (go and see SLSASampleAppDomainService.cs).  Notice this is all async of course, but we didn’t have to deal with the complexities of the async world.</p>
<p>Hit F5</p>
<p><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/11.JPG"><img class="aligncenter size-full wp-image-97" title="Browser view" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/11.JPG" alt="Browser view" width="640" height="400" /></a></p>
<p>Mate, Where is SQL Azure? Had she not come from Coffee yet?</p>
<p><strong>The Grand entrance of SQL Azure</strong></p>
<p>Up to now usual stuff, anyone can do this stuff, who knows a bit about Silverlight and RIA.</p>
<p>Now log on to SQL Azure using http://sql.azure.com</p>
<p>Create a database called <strong>SLSADb</strong> in SQL Azure</p>
<div id="attachment_98" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/12.JPG"><img class="size-full wp-image-98" title="SQL Azure" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/12.JPG" alt="SQL Azure" width="640" height="400" /></a><p class="wp-caption-text">SQL Azure</p></div>
<p>Now you have to create a database in the SQL Azure just like your local sql server schema. For that we need to download a tool called SQL Azure migration Wizard from this place.</p>
<p>http://sqlazuremw.codeplex.com/</p>
<p>download the wizard and install it on your PC.</p>
<p>Run the SQLAzureMW.exe</p>
<p>In ScriptWizard window, Click Connect to Server button and connect to your local SQL server.</p>
<div id="attachment_99" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/13.JPG"><img class="size-full wp-image-99" title="Migration Wizard" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/13.JPG" alt="Migration Wizard" width="640" height="666" /></a><p class="wp-caption-text">Migration Wizard</p></div>
<p>Oops, I am getting an error here. I think it’s not working for me.  If it is working for you then just migrate your local SLSADb to the cloud. It is easy and intutive. If not, ignore this bit and we will do this manully using our old friend SSMS.</p>
<div id="attachment_100" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/14.JPG"><img class="size-full wp-image-100" title="Error running Wizard" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/14.JPG" alt="Error running Wizard" width="640" height="632" /></a><p class="wp-caption-text">Error running Wizard</p></div>
<p>Do the following steps only when you failed to migrate the local DB to SQL Azure using migration wizard.</p>
<p>Open your SQL server Management Studio</p>
<p>Cancel the intial Connect to Server Dialogue box.</p>
<p>Click on New Query  and Connect to Server Dialogue box appears.</p>
<p>Give your SQL Azure details there. See the two screen shots below.</p>
<div id="attachment_101" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/15.JPG"><img class="size-full wp-image-101" title="Using SSMS to connect to SQL Azure" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/15.JPG" alt="Using SSMS to connect to SQL Azure" width="640" height="400" /></a><p class="wp-caption-text">Using SSMS to connect to SQL Azure</p></div>
<p>Click on Options button on the same screen and give your database name in the connect to database feild. i.e SLSADb (this is the DB that we have created in the SQL Azure as well). Sorry for the confusion, I should have put different database name for the SQLAzure DB.</p>
<div id="attachment_102" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/16.JPG"><img class="size-full wp-image-102" title="SSMS options Wizard" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/16.JPG" alt="SSMS options Wizard" width="640" height="499" /></a><p class="wp-caption-text">SSMS options Wizard</p></div>
<p>Click Connect.</p>
<p>Now copy the above Colleagues SQL table script (not the DB creation Script) and run it in the SQL window with slight modification.  See the diagram below.</p>
<div id="attachment_103" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/17.JPG"><img class="size-full wp-image-103" title="Colleague table view" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/17.JPG" alt="Colleague table view" width="640" height="400" /></a><p class="wp-caption-text">Colleague table view</p></div>
<p>Your table creation script should execute fine.</p>
<p>Now issue a select command.</p>
<p>Select * from Colleague</p>
<p>It yields zero records.</p>
<p>Now issue couple of insert statements with different names than in your local database. For your convenience, I created two records, copy, paste and run in SQL Azure.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Colleague<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Cloud1'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'SQLAzure1'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Developer Lead'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'123456'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'D3455'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'I.T'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'012345 678 999'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'07712 345 678'</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> <span style="color: #66cc66;">&#91;</span>SLSADb<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>Colleague<span style="color: #66cc66;">&#93;</span> <span style="color: #993333; font-weight: bold;">VALUES</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Cloud2'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'SQLAzure2'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'Manager'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'789654'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'D3455'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'I.T'</span><span style="color: #66cc66;">,</span> <span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'012345 678 123'</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'07712 345 111'</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Please note we changed our first names and last names in the above.</p>
<p>Now we are ready to show them in our Silverlight application.</p>
<p>Go to VS2008</p>
<p>On the Server project , open the web.config file. In the connectionstring section, you see a long string like this, which is connecting to your local SQL server.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;</pre></div></div>

<p>Change this to reflect the SQL Azure storage database with your own credentials</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">&nbsp;</pre></div></div>

<p>Save the changes and Hit F5.</p>
<p>Upsy daisy. Here we get our stuff from the SQL Azure. See the screen shot.</p>
<div id="attachment_104" class="wp-caption aligncenter" style="width: 650px"><a href="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/18.JPG"><img class="size-full wp-image-104" title="Final output from SQL Azure" src="http://www.scriptstar.co.uk/http://www.scriptstar.co.uk/wp-content/uploads/2009/11/18.JPG" alt="Final output from SQL Azure" width="640" height="400" /></a><p class="wp-caption-text">Final output from SQL Azure</p></div>
<p>That’s it. In one go, you did both Silverlight RIA stuff and SQL Azure stuff.</p>
<p>I hope you like this article. You can explore SQL Azure and Silver light from here on.</p>
<p>If you have any doubts or questions, please don’t hesitate to ask me.</p>
<p>Cheers,<br />
Narendra
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.scriptstar.co.uk%2Fsilverlight-sample-application-with-sql-azure%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.scriptstar.co.uk%2Fsilverlight-sample-application-with-sql-azure%2F&amp;style=normal&amp;service=bit.ly&amp;service_api=scriptstar%3AR_991057c9b732a05f226e1bff49cdbf3a&amp;hashtags=RIA+Services,Silverlight,SQL+Azure&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<div class="shr-publisher-82"></div>
	<p>
	    <a rev="vote-for" href="http://www.sharepointsidekick.com/Submit?url=http%3A%2F%2Fwww.scriptstar.co.uk%2Fsilverlight-sample-application-with-sql-azure%2F&borderColor=909090&textBackColor=336699&textForeColor=ffffff&countBackColor=ededed&countForeColor=000000&title=Silverlight+Sample+Application+with+SQL+Azure">
	<img alt="sidekick it" src="http://www.sharepointsidekick.com/image.axd?url=http%3A%2F%2Fwww.scriptstar.co.uk%2Fsilverlight-sample-application-with-sql-azure%2F&borderColor=909090&textBackColor=336699&textForeColor=ffffff&countBackColor=ededed&countForeColor=000000" style="border:0px"/>
	   </a>
	</p>
	
	]]></content:encoded>
			<wfw:commentRss>http://www.scriptstar.co.uk/silverlight-sample-application-with-sql-azure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

