<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:tl="http://xmlforasp.net/namespace" xmlns:dc="http://purl.org/dc/elements/1.1/" 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/"><channel><title>XML for ASP.NET Developers - Dan Wahlin</title><link>http://XMLforASP.NET</link><language>en-us</language><description>XML for ASP.NET Developers specializes in bringing you code samples and articles relating to ASP.NET, ADO.NET, XML, and Web Services.</description><pubDate>Tuesday, May 13, 2008 6:46:18 PM</pubDate><generator>XML for ASP.NET Developers Website</generator><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Silverlight 2.0 Video Tutorials</title><link>http://www.xmlforasp.net/codesection.aspx?csID=140</link><pubDate>3/9/2008</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=140</guid><description>&lt;p align="justify"&gt;
Silverlight 2.0 provides a new and exciting framework for building rich applications using C#, VB.NET or other languages that are capable of running on multiple operating systems and in multiple browsers.  Scott Guthrie recently posted a great set of tutorials on Silverlight 2.0 that are an excellent resource for getting started building Silverlight 2.0 applications.  
&lt;br /&gt;&lt;br /&gt;
Scott recently approved converting the tutorials into video so I've been busy the past few days putting together video tutorials that cover Silverlight 2.0 and the Digg.com application Scott wrote about.
&lt;br /&gt;&lt;br /&gt;
Topics covered include:
&lt;br /&gt;&lt;br /&gt;
Part 1: Creating "Hello World" with Silverlight 2 and VS 2008 Tutorial Video Tutorial 
&lt;br /&gt;
Part 2: Using Layout Management Tutorial Video Tutorial 
&lt;br /&gt;
Part 3: Using Networking to Retrieve Data and Populate a DataGrid Tutorial Video Tutorial
&lt;br /&gt; 
Part 4: Using Style Elements to Better Encapsulate Look and Feel Tutorial Video Tutorial
&lt;br /&gt;
Part 5: Using the ListBox and DataBinding to Display List Data Tutorial Video Tutorial
&lt;br /&gt; 
Part 6: Using User Controls to Implement Master/Details Scenarios Tutorial Video Tutorial
&lt;br /&gt; 
Part 7: Using Templates to Customize Control Look and Feel Tutorial Video Tutorial
&lt;br /&gt; 
Part 8: Creating a Digg Desktop Version of our Application using WPF Tutorial Video Tutorial 

&lt;/p&gt;</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Building an N-Layer ASP.NET Application with LINQ</title><link>http://www.xmlforasp.net/codesection.aspx?csID=139</link><pubDate>2/27/2008</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=139</guid><description>&lt;P&gt;.NET 3.5 has a lot of great new features that can significantly enhance developer productivity.&amp;nbsp; I've been spending some time lately working on a little sample application that demonstrates how an N-Layer ASP.NET 3.5 application can be built using LINQ, lambdas and LINQ with stored procedures.&amp;nbsp; The application is for a talk I'll be giving at &lt;A href="http://www.devconnections.com/" target=_blank mce_href="http://www.devconnections.com"&gt;DevConnections&lt;/A&gt; in April discussing how LINQ technologies can be used in an N-Layer architecture.&amp;nbsp; In a &lt;A href="http://weblogs.asp.net/dwahlin/archive/2008/02/17/linq-and-lambdas-and-sprocs-oh-my.aspx" target=_blank mce_href="http://weblogs.asp.net/dwahlin/archive/2008/02/17/linq-and-lambdas-and-sprocs-oh-my.aspx"&gt;blog post&lt;/A&gt; comparing different LINQ options I mentioned that I'd be posting the code download as soon as it was ready.
&lt;/P&gt;

&lt;P&gt;The application provides a presentation layer, business layer, data layer and model layer through separate projects as shown next:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/BuildinganNLayerA.NETApplicationwithLINQ_963D/image_2.png" mce_href="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/BuildinganNLayerA.NETApplicationwithLINQ_963D/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=476 alt=image src="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/BuildinganNLayerA.NETApplicationwithLINQ_963D/image_thumb.png" width=199 border=0 mce_src="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/BuildinganNLayerA.NETApplicationwithLINQ_963D/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;It also demonstrates how the new ListView control can be used to display data, perform insert, update and delete operations and nest other controls such as the GridView.&amp;nbsp; Databinding on the presentation layer is mainly done using the ObjectDataSource control.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/BuildinganNLayerA.NETApplicationwithLINQ_963D/image_4.png" mce_href="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/BuildinganNLayerA.NETApplicationwithLINQ_963D/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=400 alt="Application Example" src="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/BuildinganNLayerA.NETApplicationwithLINQ_963D/image_thumb_1.png" width=532 border=0 mce_src="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/BuildinganNLayerA.NETApplicationwithLINQ_963D/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;All of the queries performed in the application go against an object model created using the Visual Studio 2008 LINQ to SQL Designer.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&lt;FONT color=#ff0000&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; The included Northwind SQL Express database has been modified slightly to add a TimeStamp field into the Customer and Orders tables and contains several custom stored procedures (sprocs aren't required unless using that portion of the application).&amp;nbsp; Adding TimeStamp fields&amp;nbsp;simplifies updates so be aware that if you change the connection string to point to a standard Northwind database you'll get an error since the TimeStamp fields will be missing.&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/LINQandLambdasandSprocs.OhMy_89C7/image_2.png" mce_src="http://weblogs.asp.net/blogs/dwahlin/WindowsLiveWriter/LINQandLambdasandSprocs.OhMy_89C7/image_2.png"&gt; &lt;/P&gt;

&lt;H3&gt;&lt;BR&gt;3 Options for Data Access&lt;/H3&gt;
&lt;P&gt;Rather than focusing solely on LINQ, I wanted to show different options for data access that .NET 3.5 offers so that developers can get a feel for what's available in addition to standard LINQ queries that seem to get most of the attention these days.&amp;nbsp; I ended up creating six main data layer classes as shown next: &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Customer Query Classes:&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;CustomerDBLINQ - Executes customer related queries using inline LINQ &lt;/LI&gt;

&lt;LI&gt;CustomerDBLambda - Executes customer related queries using lambda expressions &lt;/LI&gt;

&lt;LI&gt;CustomerDBSprocs - Executes customer related queries using stored procedures and LINQ &lt;BR&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;Order Query Classes:&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;OrderDBLINQ - Executes order related queries using inline LINQ &lt;/LI&gt;

&lt;LI&gt;OrderDBLambda - Executes order related queries using lambda expressions &lt;/LI&gt;

&lt;LI&gt;OrderDBSprocs - Executes order related queries using stored procedures and LINQ &lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;I still lean toward using stored procedures due to the security and maintenance benefits they offer in more enterprise environments, but for small queries I actually prefer lambda expressions over LINQ (not sure why...just feels more object oriented I guess).&amp;nbsp; If you currently use stored procedures in your applications and haven't checked out the new LINQ to SQL Designer you'll be impressed with how easy it is to call stored procedures and pass parameters.&amp;nbsp; You never have to see or create another SqlCommand or SqlParameter object again (well...in many cases anyway).&lt;/P&gt;

&lt;H3&gt;&lt;BR&gt;Switching Between Data Access Classes&lt;/H3&gt;
&lt;P&gt;By changing a value in web.config you can switch between the different data layer classes and see which option you prefer (LINQ, lambdas or LINQ with sprocs).&amp;nbsp; All of the data access classes perform the same overall tasks, they just use different techniques to do it.&lt;/P&gt;
&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;appSettings&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
  &amp;lt;!-- 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Used to define which DB layer class should be loaded and used. 
    Valid customer values include:  Data.CustomerDBSprocs, Data.CustomerLINQ, Data.CustomerLambda
    Valid order values include: Data.OrderDBSprocs, Data.OrderLINQ, Data.OrderLambda
  &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;
  &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;add &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;key&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;CustomerDBType&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Data.CustomerDBLINQ&lt;/SPAN&gt;" &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;
  &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;add &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;key&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;OrderDBType&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;Data.OrderDBLINQ&lt;/SPAN&gt;" &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;
  &amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;When the following key is set to "true" ensure that &lt;BR&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;EnablePartialRendering is set to false on the Default.aspx ScriptManager control &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;--&amp;gt;
  &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;add &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;key&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;EnableDataContextLogging&lt;/SPAN&gt;" &lt;SPAN style="COLOR: red"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;" &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;appSettings&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;


</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Integrating Silverlight and ASP.NET AJAX</title><link>http://www.xmlforasp.net/codesection.aspx?csID=138</link><pubDate>2/10/2008</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=138</guid><description>&lt;p align="justify"&gt;This video is from a talk given by Dan Wahlin at Desert Code Camp in Phoenix, AZ that discussed how Silverlight could be integrated with ASP.NET AJAX to dynamically display albums obtained from an Amazon.com Web Service.  The audio in the room wasn't great since no microphone was used so you may need to crank it up a bit. 
&lt;/p&gt;
&lt;p align="justify"&gt;
Slides and code shown in the video can be downloaded below:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;A href="http://www.xmlforasp.net/CodeBank/Download/Blog/Integrating%20Silverlight%20with%20ASP.NET%20AJAX.ppt"&gt;PowerPoint Slides Download&lt;/A&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;A class="" href="http://www.xmlforasp.net/CodeBank/Download/Blog/AlbumViewer.zip"&gt;Code Download&lt;/A&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Getting Started with Subversion and Source Control</title><link>http://www.xmlforasp.net/codesection.aspx?csID=137</link><pubDate>8/21/2007</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=137</guid><description>&lt;p align="justify"&gt;In this video "how to" Dan Wahlin walks through the steps required to install and configure &lt;A href="http://subversion.tigris.org/" target=_blank mce_href="http://subversion.tigris.org"&gt;Subversion&lt;/A&gt; to control your .NET source code revisions.&amp;nbsp; Several commercial options exist for source control of course such as &lt;A href="http://www.sourcegear.com/vault/index.html" target=_blank mce_href="http://www.sourcegear.com/vault/index.html"&gt;Vault&lt;/A&gt; and Microsoft's &lt;A href="http://msdn2.microsoft.com/en-us/vstudio/aa718670.aspx" target=_blank mce_href="http://msdn2.microsoft.com/en-us/vstudio/aa718670.aspx"&gt;Visual SourceSafe&lt;/A&gt;&amp;nbsp;to name just two.&amp;nbsp; Subversion is an open source project (it's freely available) and has excellent documentation and support available.&amp;nbsp; It's also easy to use through the command-line or through &lt;A href="http://tortoisesvn.tigris.org/" target=_blank mce_href="http://tortoisesvn.tigris.org/"&gt;TortoiseSVN&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;In the video you'll see how to install Subversion, configure it, install the TCP/IP service, and add new or existing projects into the source control repository.&amp;nbsp; You'll also see how to use TortoiseSVN to create repositories and manipulate files in a Subversion repository.&amp;nbsp;Although the video discusses installing the TCP/IP service for accessing a repository remotely, it doesn't cover how to access the repository through HTTP.&amp;nbsp; You can find more information about that task and &lt;A href="http://svnbook.red-bean.com/nightly/en/svn.serverconfig.choosing.html#svn.serverconfig.choosing.apache" target=_blank mce_href="http://svnbook.red-bean.com/nightly/en/svn.serverconfig.choosing.html#svn.serverconfig.choosing.apache"&gt;how to configure it with Apache here&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Links mentioned in the video are included below:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Subversion Project Site:&lt;/STRONG&gt;&amp;nbsp; &lt;A href="http://subversion.tigris.org/" mce_href="http://subversion.tigris.org"&gt;http://subversion.tigris.org&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Rick Strahl's Step-By-Step Subversion Article:&lt;/STRONG&gt;&amp;nbsp; &lt;A title=http://www.west-wind.com/presentations/subversion/ href="http://www.west-wind.com/presentations/subversion/" mce_href="http://www.west-wind.com/presentations/subversion/"&gt;http://www.west-wind.com/presentations/subversion/&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Subversion Online Book:&lt;/STRONG&gt; &lt;A title=http://svnbook.red-bean.com/nightly/en/index.html href="http://svnbook.red-bean.com/nightly/en/index.html" mce_href="http://svnbook.red-bean.com/nightly/en/index.html"&gt;http://svnbook.red-bean.com/nightly/en/index.html&lt;/A&gt;&lt;/p&gt;
</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>First Look at Visual Studio .NET 2008 and the LinqDataSource </title><link>http://www.xmlforasp.net/codesection.aspx?csID=136</link><pubDate>8/6/2007</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=136</guid><description>&lt;p align="justify"&gt;Visual Studio .NET 2008 provides many new features that will definitely enhance developer productivity.  In this video tutorial I provide an introductory look at VS.NET 2008 and show a few features such as multi-targeting, split view, and the LinqDataSource control.  In the video you will see how to build an ASP.NET page that retrieves data from a data context object (created with the new LINQ to SQL designer) and binds it to various controls using the LinqDataSource control.&lt;/p&gt;</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Using the New ASP.NET ListView Control</title><link>http://www.xmlforasp.net/codesection.aspx?csID=135</link><pubDate>8/6/2007</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=135</guid><description>&lt;p align="justify"&gt;ASP.NET 3.5 introduces a new control called the ListView that allows developers to have 100% control over the HTML markup that is generated while still providing paging, inserting, updating, and deleting support. To me the ListView control is a nice blend between the GridView and Repeater controls with new features added. 
&lt;/p&gt;
&lt;p&gt;
In this video I walk through the fundamentals of using the ListView control and show how you can use the new CSS tools in VS.NET 2008 to create a scrollable ListView control with a frozen header. See my previous blog post if you are interested in learning how to freeze GridView control headers in IE and FireFox.&lt;/p&gt;
</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Working with ASP.NET AJAX UpdatePanel Properties</title><link>http://www.xmlforasp.net/codesection.aspx?csID=134</link><pubDate>5/15/2007</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=134</guid><description>&lt;p align="justify"&gt;
This video tutorial demonstrates the affect the UpdatePanel&amp;#39;s UpdateMode and ChildrenAsTriggers properties have on updating a panel&amp;#39;s content.&amp;nbsp; The video starts out by discussing the UpdateMode property and shows why you may want to know about it when using multiple UpdatePanel controls on a single page.&amp;nbsp; It then discusses the ChildrenAsTriggers property and shows how you can prevent child controls from updating their parent UpdatePanel control.&amp;nbsp; Examples of nesting UpdatePanel controls to provide a master-details style view of data is also shown.&lt;/p&gt;</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Binding Data to ASP.NET 2.0 Server Controls </title><link>http://www.xmlforasp.net/codesection.aspx?csID=133</link><pubDate>3/30/2007</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=133</guid><description>&lt;p align="justify"&gt;Based upon the amount of interest in a &lt;a href="http://weblogs.asp.net/dwahlin"&gt;blog post&lt;/a&gt; I did awhile back I decided to put together a quick video demonstrating how the SqlDataSource can be used quickly and easily and how controls can be embedded using templates. 

Keep in mind that I am not a big fan of using the SqlDataSource in "enterprise" applications but I do find myself using it quite a bit for admin pages where I need to update look-up tables or perform fairly straightforward operations with a minimal amount of code. For N-Tier/N-Layer applications I prefer to use the ObjectDataSource control where appropriate.&lt;/p&gt;</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Calling Web Services Asynchronously with ASP.NET </title><link>http://www.xmlforasp.net/codesection.aspx?csID=132</link><pubDate>3/30/2007</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=132</guid><description>&lt;p align="justify"&gt;This video tutorial walks you through the fundamentals of calling Web Services asynchronously from an ASP.NET page using the .NET 2.0 event driven model exposed by Web Service proxy objects.  There are several different options for calling Web Services asynchronously including polling, callbacks and wait handles, but the event driven model is quite easy to use and does not put as much pressure on the ASP.NET thread pool as the other options.
&lt;/p&gt;</description><category>Articles</category></item><item><dc:creator>Dan Wahlin - Wahlin Consulting LLC</dc:creator><title>Creating Web Services with the .NET Framework </title><link>http://www.xmlforasp.net/codesection.aspx?csID=131</link><pubDate>3/10/2007</pubDate><guid>http://www.xmlforasp.net/codesection.aspx?csID=131</guid><description>&lt;p align="justify"&gt;The video discusses how to create a Web Service from scratch but also discusses some of the pros and cons that you should know about.  For example, many people will return a DataSet from a Web Service.  While that works, it is not very interoperable with non-.NET clients since the generated WSDL will be quite vague about what the Web Service actually returns.  By creating custom types (classes) the WSDL can more accurately show a client exactly what they are going to get back.  I have also seen many people put all of the code for a Web Service into the Web Method.  That works, but you can achieve better code re-use by creating distinct layers for business and data functionality.  These concepts and a few others are discussed in the video. Other topics covered include consuming a Web Service from an ASP.NET Web Form. 
&lt;/p&gt;</description><category>Articles</category></item></channel></rss>