<?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>Gary Pretty's Blog &#187; .net 3.5</title>
	<atom:link href="http://blog.garypretty.co.uk/index.php/tag/net-35/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.garypretty.co.uk</link>
	<description>.Net Development &#38; General Tech Related News</description>
	<lastBuildDate>Sat, 04 Feb 2012 00:32:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ASP.NET 3.5 Dynamic Data Tutorial Series &#8211; Part 1 &#8211; What is Dynamic Data and creating a basic dynamic data web site.</title>
		<link>http://blog.garypretty.co.uk/index.php/2008/05/07/aspnet-35-dynamic-data-tutorial-series-part-1-what-is-dynamic-data-and-creating-a-basic-dynamic-data-web-site/</link>
		<comments>http://blog.garypretty.co.uk/index.php/2008/05/07/aspnet-35-dynamic-data-tutorial-series-part-1-what-is-dynamic-data-and-creating-a-basic-dynamic-data-web-site/#comments</comments>
		<pubDate>Wed, 07 May 2008 16:12:08 +0000</pubDate>
		<dc:creator>Gary Pretty</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[Dynamic Data]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://blog.garypretty.co.uk/index.php/2008/05/07/aspnet-35-dynamic-data-tutorial-series-part-1-what-is-dynamic-data-and-creating-a-basic-dynamic-data-web-site/</guid>
		<description><![CDATA[Last week I attended the MSDN Roadshow 2008 (you can read my write up of the event along with some useful links here), and one of the topics presented on the day were the upcoming ASP.NET 3.5 Extensions.  Mike Ormond did an excellent presentation on the upcoming release including a hands on demo using some &#8230; </p><p><a class="more-link block-button" href="http://blog.garypretty.co.uk/index.php/2008/05/07/aspnet-35-dynamic-data-tutorial-series-part-1-what-is-dynamic-data-and-creating-a-basic-dynamic-data-web-site/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Last week I attended the MSDN Roadshow 2008 (you can read my <a href="http://blog.garypretty.co.uk/index.php/2008/05/07/msdn-roadshow-2008-review-and-useful-links/" target="_blank">write up of the event</a> along with some useful links <a href="http://blog.garypretty.co.uk/index.php/2008/05/07/msdn-roadshow-2008-review-and-useful-links/" target="_blank">here</a>), and one of the topics presented on the day were the upcoming ASP.NET 3.5 Extensions.  Mike Ormond did an excellent presentation on the upcoming release including a hands on demo using some of the preview releases currently available.</p>
<p>In this tutorial series I am going to focus on the Dynamic Data controls within the extensions and try and give some guidance on what Dynamic Data is, what it can do for you and how to do it.</p>
<p>In this post, Part 1, I am going to discuss what Dynamic Data is and how you can very quickly create something functional.  In future posts I will look at some of the more advanced topics and techniques available.</p>
<p>This is my first tutorial series, so please do post any comments you have (good or bad <img src='http://blog.garypretty.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )!</p>
<p><strong></strong></p>
<p><strong>What is Dynamic Data?</strong></p>
<p>Dynamic Data is extremely cool.  In short, it allows a developer to create a data driven web application that allows you view data within a database, insert, update and delete records, all rounded off with automated validation to go with it.  &#8220;Great&#8230;but I can already do that&#8221;, I hear you say, well that&#8217;s the best bit, the whole process of getting a web application, with master / detail web forms and full editing capabilities, up and running only takes a couple of minutes!</p>
<p>Once created, the resulting application can be customised very easily in order to display data to suit your needs, modify the way in which input occurs , for example, wherever the user inserts or edits a date field, you might want to have a Microsoft .Net Calendar Control instead of having them type the date in manually. You can also set logic on your database fields from within the application.  For example, you might want to add a range to an integer field or check for a pattern within a string using regular expressions.  Again, this is all possibly and relatively simple to accomplish.</p>
<p>Ok, so you know what Dynamic Data is now, so lets have a look at what you need to create a Dynamic Data web site and follow this tutorial.</p>
<p> </p>
<p><strong>Downloading the preview and getting the right tools</strong></p>
<p>Firstly, for this tutorial you are going to need a copy of either Visual Studio 2008, or <a href="http://www.microsoft.com/express/vwd/" target="_blank">Visual Web Developer Express 2008</a>.  Visual Studio Web Developer Express 2008 is a free IDE from Microsoft for developers to use, if you don&#8217;t have a copy of Visual Studio then I would definitely suggest checking out the Express edition web site <a href="http://www.microsoft.com/express/vwd/" target="_blank">here</a>.</p>
<p>Next you need to download and install the ASP.NET 3.5 Extensions from <a href="http://go.microsoft.com/fwlink/?LinkID=105029" target="_blank">here</a>.  This package contains different parts that make up the extensions, so of which are now outdated, so you will also need to download the <a href="http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=954" target="_blank">latest release of the ASP.NET Dynamic Data controls</a> from <a href="http://code.msdn.microsoft.com/dynamicdata/Release/ProjectReleases.aspx?ReleaseId=954" target="_blank">here</a>.</p>
<p>Of course, as we are going to create a data driven web site, you need a database. If you don&#8217;t already have it, go and download a copy of <a href="http://msdn.microsoft.com/en-gb/express/bb410791.aspx" target="_blank">SQL Server 2005 Express Edition</a> from <a href="http://msdn.microsoft.com/en-gb/express/bb410791.aspx" target="_blank">here</a>.  You can use any database with this tutorial, but I am using the <a href="http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004" target="_blank">Adventure Works sample database for SQL Server 2005</a> available from <a href="http://www.codeplex.com/MSFTDBProdSamples/Release/ProjectReleases.aspx?ReleaseId=4004" target="_blank">here</a> (it is the top link that you will need, AdventureWorksDb.msi).</p>
<p>I won&#8217;t go into setting up your sample database here, or installing / configuring SQL Server and Visual Studio.  If you need any help though, the web is awash with assistance, just do a Google search and you&#8217;re sure to find a tutorial / tips site to help you.  Obviously, there is supporting documentation for everything as well.</p>
<p> </p>
<p><strong>Building your first Dynamic Data Web Site</strong></p>
<p><strong>1.</strong>  Open Visual Studio / Visual Web Developer.  By now you should have all of the necessary preview extensions &amp; controls installed.  Select <em>File -&gt; New Web Site.  </em>Now that you have installed the Dynamic Data preview installed you will notice that there is now a couple of new project templates available for you to use and for this example we are going to use the <em><strong>Dynamic Data Web Application</strong></em> template as shown below.</p>
<p><a href="http://blog.garypretty.co.uk/wp-content/dynamic-data-web-app-proj-template.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.garypretty.co.uk/wp-content/dynamic-data-web-app-proj-template-thumb.jpg" border="0" alt="dynamic_data_web_app_proj_template" width="491" height="359" /></a></p>
<p> </p>
<p><a href="http://blog.garypretty.co.uk/wp-content/dbconnection.jpg"><img style="border-right: 0px; border-top: 0px; margin: 0px 0px 0px 20px; border-left: 0px; border-bottom: 0px" src="http://blog.garypretty.co.uk/wp-content/dbconnection-thumb.jpg" border="0" alt="dbconnection" width="244" height="364" align="right" /></a><strong>2.</strong>  Now we need to establish a connection to the database.  To do this, click on <em>View -&gt; Server Explorer</em>. Once the Server Explorer tab is open, right click within it and select New Connection.</p>
<p>You should then see a connection settings window shown to the right.</p>
<p>Enter your database server details here and select the database you wish to work with.</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><strong>3. </strong> Now that we have configured our database connection, we should now be able to see our database listed within the server explorer and you should have a tree view of your database where you can see your tables, views, stored procs etc.Now, we have to define our data model.  Sound scary? Well don&#8217;t worry, because this is painfully easy as well.Within your Solution Explorer, right click on the project name and select <em>Add New Item&#8230; </em></p>
<p><em>You will notice that you will now be able to select a &#8220;LINQ to SQL Classes&#8221; item.  </em></p>
<p><a href="http://blog.garypretty.co.uk/wp-content/linq2sqlitem.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.garypretty.co.uk/wp-content/linq2sqlitem-thumb.jpg" border="0" alt="linq2sqlitem" width="495" height="335" /></a></p>
<p>Add one of these items and you will be asked if you want to create an APP_CODE folder, say YES to this as this is required for your data model.</p>
<p> </p>
<p><strong>4.</strong>  Once Visual Studio / Visual Web Developer has finished creating the new LINQ to SQL Classes item, you will be presented with a blank window for the new item (.dbml file).  To create your model, simply drag the tables you want in your web site from your database in Server Explorer into this window like below.  You will notice that will even persist the table relationships already setup with your database.</p>
<p><a href="http://blog.garypretty.co.uk/wp-content/dragtables.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.garypretty.co.uk/wp-content/dragtables-thumb.jpg" border="0" alt="dragtables" width="498" height="409" /></a></p>
<p>I have chosen to drag the tables associated with Person information into my model.When you are happy with your selection, save this dbml file.</p>
<p> </p>
<p><strong>5.</strong>  The one last thing we need to do before our new data driven web application will work is to edit a line in our configuration file.  The security minded people at Microsoft have switched off the automatic creation of all table &#8216;scaffolding&#8217; by default and we need to enable it.  We are going to enable it for all tables in the model, but in a real world situation you would enable it only for tables you actually wanted to expose though this method.Open your Web.Config file and amend the following line to read as <em>true </em>like below.</p>
<ol>
<div class="csharpcode">&lt;dynamicData dataContextType=<span class="str">&#8220;&#8221;</span> enableTemplates=<span class="str">&#8220;true&#8221;</span>&gt;</div>
</ol>
<p><strong></strong></p>
<p><strong>6.</strong>  Now run your web application and hopefully, you should have a functional web application that allows you to View, Insert, Edit and Delete information within your database, like the one below.<br />
<a href="http://blog.garypretty.co.uk/wp-content/workingapp.jpg"><br />
<img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" src="http://blog.garypretty.co.uk/wp-content/workingapp-thumb.jpg" border="0" alt="workingapp" width="492" height="352" /></a></p>
<p> </p>
<p><strong>What&#8217;s Next </strong></p>
<p>Now that you have your working application, have a good look around.  In the next part of this series, we will look at the application itself and what you have got right out of the box and point out a few things that you might not have noticed.</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/.net+3.5' rel='tag' target='_self'>.net 3.5</a>, <a class='technorati-link' href='http://technorati.com/tag/Dynamic+Data' rel='tag' target='_self'>Dynamic Data</a>, <a class='technorati-link' href='http://technorati.com/tag/sql+server' rel='tag' target='_self'>sql server</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.garypretty.co.uk/index.php/2008/05/07/aspnet-35-dynamic-data-tutorial-series-part-1-what-is-dynamic-data-and-creating-a-basic-dynamic-data-web-site/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>MSDN Roadshow 2008 Review and Useful Links</title>
		<link>http://blog.garypretty.co.uk/index.php/2008/05/07/msdn-roadshow-2008-review-and-useful-links/</link>
		<comments>http://blog.garypretty.co.uk/index.php/2008/05/07/msdn-roadshow-2008-review-and-useful-links/#comments</comments>
		<pubDate>Wed, 07 May 2008 10:08:46 +0000</pubDate>
		<dc:creator>Gary Pretty</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[MSDN]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[ADO.NET]]></category>
		<category><![CDATA[ASP.NET MVC]]></category>
		<category><![CDATA[Dynamic Data]]></category>
		<category><![CDATA[Microsoft Robotics]]></category>
		<category><![CDATA[XNA Framework]]></category>

		<guid isPermaLink="false">http://blog.garypretty.co.uk/index.php/2008/05/07/msdn-roadshow-2008-review-and-useful-links/</guid>
		<description><![CDATA[Ok, so a few weeks ago I posted about my plans to attend the MSDN Roadshow 2008 in Manchester and I said that I would post about the event once I had attended.&#160; So as promised here is that very post along with some useful links; Firstly, the venue for this years event was excellent.&#160; &#8230; </p><p><a class="more-link block-button" href="http://blog.garypretty.co.uk/index.php/2008/05/07/msdn-roadshow-2008-review-and-useful-links/">Continue reading &#187;</a>]]></description>
			<content:encoded><![CDATA[<p>Ok, so a few weeks ago I posted about my plans to attend the MSDN Roadshow 2008 in Manchester and I said that I would post about the event once I had attended.&#160; So as promised here is that very post along with some useful links;</p>
<p>Firstly, the venue for this years event was excellent.&#160; The Odeon in Manchester City Centre in the Printworks is quite simply huge.&#160; Luckily there were escalators for those of use who were to lazy to climb all of the stairs.</p>
<p>Once you reached the third floor, we were greeted by poster boxes with MSDN posters inside with some nice quotes, such as &quot;There&#8217;s No Place Like 127.0.0.1&quot; and &quot;I&#8217;ll make him a program he can&#8217;t refuse&quot;, which was a nice touch I thought. <img src='http://blog.garypretty.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Made the whole thing feel like more of an event rather than just a meeting.</p>
<p>In the corridor outside of the actual conference room were the usual stands familiar to those who have attended a Roadshow before, such as the registration table, a stand with discount books from the guys over at <a href="http://www.computermanuals.co.uk">Computer Manuals</a> selling discounted books on a variety of subjects from Expression to LINQ and of course, every developers favourite stand, the SWAG stand, with free goodies like the updated Developers Highway Code (which is available for download and I have included a link in the useful links later in this post).&#160; We did all get a free software pack when we left, but more on that shortly.</p>
<p>In addition to the usual stands this year though, we were treated to a couple of really interesting tables showing off the XNA Framework on a dev Xbox 360 and the new Microsoft Robotics studio.&#160; I have to say, some of the games produced with the XNA framework for the 360 were pretty impressive and most of them are available as starter kits from Microsoft if you&#8217;re interested.&#160; I will include some links for both of these areas at the end of this post.</p>
<p><a href="http://blog.garypretty.co.uk/wp-content/imag0038.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 20px 0px 0px; border-right-width: 0px" height="249" alt="IMAG0038" src="http://blog.garypretty.co.uk/wp-content/imag0038-thumb.jpg" width="330" align="left" border="0" /></a>The conference room itself was actually a cinema room (surprisingly being at the Odeon <img src='http://blog.garypretty.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ), which was fantastic.&#160; This meant most people got comfortable seats to enjoy the show and those all important cup holders! I arrived slightly late, and so didn&#8217;t manage to get a seat, however, the nice Roadshow staff got me a seat and put me right at the side of the stage and I got a ringside seat which was great.&#160; As you can see from the picture to the right (apologies for the quality, somehow I managed to set my camera phones&#8217; resolution unusually low by mistake) of MSDNs Mike Ormond presenting, the slide being on a cinema screen really helped, as they were always clear and nobody was struggling to see anything.</p>
<p>The presentations themselves were, as always, of an excellent quality, with the speakers conveying their expert knowledge in their respective topics clearly and concisely.&#160; I particularly enjoyed <a href="http://www.mikeo.co.uk">Mike Ormond</a>s&#8217; talk on the ASP.NET 3.5 Extensions, especially the new Dynamic Data capabilities (which I am hopefully going to be posting a small tutorial series about shortly. If you&#8217;re interested, add this blog to you&#8217;re favourites or subscribe to my RSS Feed).</p>
<p>The refreshments this year were good, a choice between ham, cheese and chicken sandwiches, along with crisps and soft drinks for lunch.&#160; Very nice Coffee during the breaks and even popcorn or Ben and Jerrys ice cream in the afternoon!</p>
<p>As I have already mentioned, if you handed in your feedback form and your pass before you left you were treated to a nice software pack, which didn&#8217;t disappoint.&#160; Contained within the set were promotional copies of Windows Server 2008 32bit and 64bit editions, SQL Server 2008 Preview along with a voucher to get a development copy when it is released, and my personal favourite, a full copy of Visual Studio 2008.</p>
<p>All in all, an excellent day, well put together and very well received!</p>
<p>One last note, the MSDN Roadshow&#8217;s are an invaluable free event from Microsoft giving excellent technical and hands-on insight into the latest techniques and strategies for developers.&#160; Every year they seem to sell out really fast, so my one message to you for next year is&#8230;.<strong>REGISTER EARLY!</strong></p>
<p>Now as promised, some useful links regarding the days speakers, events and topics;   <br /><strong></strong></p>
<p><strong>Presentation Slides </strong></p>
</p>
<p>Definitely worth a look through&#8230;.. </p>
<li><a href="http://download.microsoft.com/documents/uk/msdn/events/MikeTaulty_Session1_ADO_NEXT.pptx">ADO.NEXT &#8211; Entity Framework &amp; Data Services</a> (PPTX) </li>
<li><a href="http://download.microsoft.com/documents/uk/msdn/events/MikeOrmond_ASPNETNEXT_Roadshow.pptx">ASP.NEXT &#8211; The ASP.NET 3.5 Extensions</a> (PPTX) </li>
<li><a href="http://download.microsoft.com/documents/uk/msdn/events/Silverlight2_Moth_timings.pptx">Building Rich Internet UI with Silverlight 2</a> (PPTX) </li>
<li><a href="http://download.microsoft.com/documents/uk/msdn/events/TeamSuiteSession4.pptx">Getting the most from the Visual Studio Team Suite Toolbox</a> (PPTX)<strong>      <br /></strong><strong>     <br /></strong>
<p><strong>       <br />Speakers Blog&#8217;s</strong></p>
<p>I cannot recommend subscribing to these blogs enough.&#160; I read them regularly and the writers never fail to deliver worthwhile and timely posts regarding the latest in Microsoft technology. </p>
</li>
<li><a href="http://blogs.msdn.com/mikeormond/" target="_blank">Mike Ormond&#8217;s blog</a> </li>
<li><a href="http://www.danielmoth.com/Blog/" target="_blank">Daniel Moth&#8217;s blog</a> </li>
<li><a href="http://mtaulty.com/CommunityServer/blogs/mike_taultys_blog/" target="_blank">Mike Taulty&#8217;s blog</a> </li>
<li><a href="http://blogs.msdn.com/ukvsts/" target="_blank">Neil Kidd&#8217;s team blog</a><strong>      <br /></strong><strong>     <br /></strong>
<p><strong>       <br />Sites regarding specific topics of this years Roadshow</strong></p>
<p>These are some links referencing the actual subjects and technology discussed during this years roadshow. </p>
</li>
<li><a href="http://code.msdn.microsoft.com/dynamicdata" target="_blank">Dynamic Data</a> </li>
<li><a href="http://go.microsoft.com/fwlink/?LinkID=110956" target="_blank">ASP.NET MVC Preview 2</a> </li>
<li><a href="http://www.microsoft.com/uk/msdn/screencasts/tags/ADO.NET/default.aspx?pg=3" target="_blank">MSDN UK screencasts on ADO.NET</a> </li>
<li><a href="http://asp.net/downloads/3.5-extensions" target="_blank">ASP.NET 3.5 Extensions Preview</a> </li>
<li><a href="http://blogs.msdn.com/mikeormond/archive/2008/04/23/asp-next.aspx" target="_blank">Excellent blog post from Mike Ormond with more great links for ASP.NET 3.5 Extensions</a> </li>
<li><a href="http://silverlight.net" target="_blank">Silverlight</a><strong></strong><strong> </strong></li>
<p> <strong>
<p></p>
<p> </strong>
<p><strong>Xbox 360 XNA Game Framework and Microsoft Robotics Studio and the Developer Highway Code</strong></p>
<p>As promised, a couple of links to the areas that were the subject of two impressive stands this years event.</p>
<li><a href="http://www.xna.com/" target="_blank">Microsoft XNA (with links for both casual and professional games development)</a> </li>
<li><a href="http://msdn.microsoft.com/en-us/robotics/default.aspx" target="_blank">Microsoft Robotics Developer Center</a> </li>
<li><a href="http://msdn.microsoft.com/en-gb/security/aa473878.aspx" target="_blank">Microsoft Developer Highway Code Download</a> </li>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Technorati Tags: <a class='technorati-link' href='http://technorati.com/tag/.net+3.5' rel='tag' target='_self'>.net 3.5</a>, <a class='technorati-link' href='http://technorati.com/tag/ADO.NET' rel='tag' target='_self'>ADO.NET</a>, <a class='technorati-link' href='http://technorati.com/tag/ASP.NET+MVC' rel='tag' target='_self'>ASP.NET MVC</a>, <a class='technorati-link' href='http://technorati.com/tag/Dynamic+Data' rel='tag' target='_self'>Dynamic Data</a>, <a class='technorati-link' href='http://technorati.com/tag/Microsoft+Robotics' rel='tag' target='_self'>Microsoft Robotics</a>, <a class='technorati-link' href='http://technorati.com/tag/MSDN' rel='tag' target='_self'>MSDN</a>, <a class='technorati-link' href='http://technorati.com/tag/Silverlight' rel='tag' target='_self'>Silverlight</a>, <a class='technorati-link' href='http://technorati.com/tag/XNA+Framework' rel='tag' target='_self'>XNA Framework</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.garypretty.co.uk/index.php/2008/05/07/msdn-roadshow-2008-review-and-useful-links/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

