<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-724685353170639218</id><updated>2011-11-28T00:25:43.119Z</updated><category term='performance tuning'/><category term='70-568'/><category term='Designer Time bug'/><category term='Windows Forms'/><category term='Visual Studio 2008'/><category term='Certification'/><category term='SQL Server'/><category term='Debugging'/><category term='ASP.NET MVC'/><category term='ASP.NET'/><category term='.NET'/><category term='ADO.NET'/><category term='Windows 7'/><title type='text'>richardod's blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>14</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-2214754042775322706</id><published>2009-08-25T18:53:00.001+01:00</published><updated>2009-08-25T18:53:07.832+01:00</updated><title type='text'>Sample Photo with Nikon 105mm F/2.8 Lens Micro</title><content type='html'>&lt;p&gt;Here’s a photo I’ve uploaded taken with this lens to Flickr (Click on the image to see it on Flickr):&lt;/p&gt; &lt;a title="Dragonfly mating by RichardOD, on Flickr" href="http://www.flickr.com/photos/22647225@N00/3853049153/"&gt;&lt;img alt="Dragonfly mating" src="http://farm4.static.flickr.com/3476/3853049153_2cbfcfaac5.jpg" width="500" height="334" /&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-2214754042775322706?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/2214754042775322706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/08/sample-photo-with-nikon-105mm-f28-lens.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/2214754042775322706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/2214754042775322706'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/08/sample-photo-with-nikon-105mm-f28-lens.html' title='Sample Photo with Nikon 105mm F/2.8 Lens Micro'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm4.static.flickr.com/3476/3853049153_2cbfcfaac5_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-6521689634044667155</id><published>2009-06-14T21:21:00.001+01:00</published><updated>2009-06-14T21:21:59.268+01:00</updated><title type='text'>Returning Method Input Parameters as the result with Moq</title><content type='html'>&lt;p&gt;Today I discovered how I can return the input on a &lt;a href="http://code.google.com/p/moq/"&gt;Moq&lt;/a&gt; Mock object as the output. Let’s imagine we have an abstract class called (oddly) EchoInput:&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;abstract&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;EchoInput&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: #2b91af"&gt;&lt;font face="Courier"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;abstract&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; SayIt(&lt;span style="color: blue"&gt;string&lt;/span&gt; input);&lt;/p&gt; &lt;/blockquote&gt;  &lt;p style="margin: 0px; font-family: courier new; background: white; color: black; font-size: 10pt"&gt;&lt;font size="3"&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;We wish to create a Mock object for this abstract class that returns the value of the input as the return value for the method SayIt. To do that we simply use an overload of the Moq Return’s method that allows us to specify a &lt;a href="http://msdn.microsoft.com/en-us/library/bb534960.aspx"&gt;Func&amp;lt;&amp;gt; delegate&lt;/a&gt; that simply matches the signature of the method:&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;var&lt;/span&gt; testDouble = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Mock&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;EchoInput&lt;/span&gt;&amp;gt;();&lt;/p&gt;  &lt;p&gt;testDouble.Setup(mock =&amp;gt; (mock.SayIt(Moq.&lt;span style="color: #2b91af"&gt;It&lt;/span&gt;.IsAny&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;()))).Returns((&lt;span style="color: blue"&gt;string&lt;/span&gt; input) =&amp;gt; input);&lt;/p&gt;  &lt;p&gt;If you don’t match up the parameters in the call to return you will simply get a “&lt;a href="http://msdn.microsoft.com/en-us/library/system.reflection.targetparametercountexception.aspx"&gt;System.Reflection.TargetParameterCountException&lt;/a&gt;” at runtime. This would happen if you used the example below (deliberately incorrect code):&lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;     &lt;p style="margin: 0px"&gt;testDouble.Setup(mock =&amp;gt; (mock.SayIt(Moq.&lt;span style="color: #2b91af"&gt;It&lt;/span&gt;.IsAny&amp;lt;&lt;span style="color: blue"&gt;string&lt;/span&gt;&amp;gt;())))&lt;/p&gt;      &lt;p style="margin: 0px"&gt;.Returns((&lt;span style="color: blue"&gt;string&lt;/span&gt; input, &lt;span style="color: blue"&gt;int&lt;/span&gt; x) =&amp;gt; input);&lt;/p&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;It is worth noting that the number of parameters need to match the method’s signature. It doesn’t matter what you call the parameters but for readability it is worth giving them the same names as the original parameters.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-6521689634044667155?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/6521689634044667155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/06/returning-method-input-parameters-as.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/6521689634044667155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/6521689634044667155'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/06/returning-method-input-parameters-as.html' title='Returning Method Input Parameters as the result with Moq'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-2975991706381542220</id><published>2009-05-25T21:34:00.001+01:00</published><updated>2009-05-25T21:34:22.740+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7'/><title type='text'>Installing Windows 7 RC1 on IBM Thinkpad Z60m</title><content type='html'>&lt;p&gt;After reading lots about Windows 7 and how good it is supposed to be on laptops, I decided to take the plunge and upgrade my Thinkpad Z60m to Windows 7. Previously I had been running Windows XP on the laptop, as I don’t think it is that suitable for running Vista. Though Windows 7 has yet to be released, I had a copy of Windows 7 RC Ultimate and decided my laptop would be a good candidate for installing Microsoft’s latest desktop operating system.&lt;/p&gt;  &lt;p&gt;As I don’t do anything overly important on my laptop I decided the upgrade wouldn’t be that much of a risk (I can always go back to XP if needed). To start off I decided to upgrade the machine from the base specification, by &lt;a href="http://www.crucial.com/uk/store/listparts.aspx?model=ThinkPad%20Z60m%20Series%20%28All%20Types%29" target="_blank"&gt;upgrading the memory to 2 GB of RAM from Crucial&lt;/a&gt; (the maximum RAM allowed in a Z60m) and upgrading the standard 100GB 5400 RPM hard drive to a &lt;a href="http://www.ebuyer.com/product/145602" target="_blank"&gt;better spec 7200 RPM, 320GB Seagate drive&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;After installing the new RAM and hard drive, I proceeded to install Windows 7 from DVD. The installation was very quick and painless. Once installed I discovered the wireless wasn’t working out of the box and the screen resolution wasn’t right. After plugging in a CAT-5 cable, I downloaded the latest Microsoft updates, installed them and rebooted.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_S3YrXat7Lwo/ShsAxg9FWqI/AAAAAAAAADg/f5-wdc-lS-g/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Windows update history" border="0" alt="Windows update history" src="http://lh5.ggpht.com/_S3YrXat7Lwo/ShsAyQ3cDMI/AAAAAAAAADk/1yuLKSH0aoY/image_thumb%5B1%5D.png?imgmax=800" width="644" height="404" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Once I had installed the updates the screen was displaying the correct resolution, and I could now use the wireless. I then decided to benchmark the system to get a performance score:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_S3YrXat7Lwo/ShsAy8RXyJI/AAAAAAAAADo/lckhm8HSSAw/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_S3YrXat7Lwo/ShsAzZp1HSI/AAAAAAAAADs/oZqYfDswqRw/image_thumb%5B3%5D.png?imgmax=800" width="644" height="404" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;My overall score was 3.7, not bad considering the Z60m is now an old laptop (bear in mind these scores need to taken with a pinch of salt). It seems the new hard drive has a good performance score of 5.9, with the lowest scores being achieved from the Processor (Pentium M 2.0 GHz) and the graphics (ATI Mobility Radeon X600)- both with a score of 3.7.&lt;/p&gt;  &lt;p&gt;Since installing Windows 7 it seems to be very stable for a RC. The only other software I have installed so far is MSN Messenger and Windows Live Writer. This blog post has been written using Windows Live Writer in Windows 7. With the ease of installation and strong hardware support following Windows Update, my first impressions of Windows 7 are resoundingly positive- I now just need to install some more software on the laptop.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-2975991706381542220?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/2975991706381542220/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/05/installing-windows-7-rc1-on-ibm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/2975991706381542220'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/2975991706381542220'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/05/installing-windows-7-rc1-on-ibm.html' title='Installing Windows 7 RC1 on IBM Thinkpad Z60m'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_S3YrXat7Lwo/ShsAyQ3cDMI/AAAAAAAAADk/1yuLKSH0aoY/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-5214507721591168627</id><published>2009-05-20T21:48:00.001+01:00</published><updated>2009-05-20T21:55:19.867+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET MVC'/><title type='text'>Started reading Pro ASP.NET MVC Framework</title><content type='html'>&lt;p&gt;Today my copy of &lt;a href="http://www.amazon.com/exec/obidos/ASIN/1430210079/myblo02-21"&gt;Pro ASP.NET MVC Framework arrived from Amazon&lt;/a&gt;. I’m hoping this book will teach me how to become an expert at ASP.NET MVC. So far I’ve read the first introductory chapter and I must say I am very impressed.&lt;/p&gt;  &lt;p&gt;It looks like you can &lt;a href="http://www.apress.com/book/downloadfile/4358"&gt;view a sample chapter in PDF format&lt;/a&gt; for free from the Apress Web site.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-5214507721591168627?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/5214507721591168627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/05/started-reading-pro-aspnet-mvc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/5214507721591168627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/5214507721591168627'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/05/started-reading-pro-aspnet-mvc.html' title='Started reading Pro ASP.NET MVC Framework'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-615870333140101197</id><published>2009-05-17T18:30:00.000+01:00</published><updated>2009-05-17T18:54:59.066+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ADO.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Forms'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='Certification'/><category scheme='http://www.blogger.com/atom/ns#' term='70-568'/><title type='text'>Microsoft 70-568 exam study guide</title><content type='html'>&lt;p&gt;Several years ago (maybe 5 now) when I was studying for my MCSD.NET, I stumbled upon a &lt;a href="http://www.codeclinic.com/70-316skills.htm" target="_blank"&gt;site for MS 70-316&lt;/a&gt;, which contains lots of links to help study for the &lt;a href="http://www.microsoft.com/learning/en/us/exams/70-316.mspx" target="_blank"&gt;Microsoft 70-316 exam&lt;/a&gt;. Back then you had a lot of excellent books for these exams, like &lt;a href="http://www.techcontent.com/" target="_blank"&gt;Amit Kalani’s study guides&lt;/a&gt;, which I thought were the best around at the time.&lt;/p&gt;  &lt;p&gt;Roll on several years later I find myself studying for &lt;a href="http://www.microsoft.com/learning/en/us/Exams/70-568.aspx" target="_blank"&gt;Microsoft 70-568&lt;/a&gt;. Currently there are no specific books for this exam. I’m not a fan of doing courses- I prefer reading and experimenting. So this post is my own lists of links and recommended books that a test candidate may find useful.&lt;/p&gt;  &lt;p&gt;It turns out that the upgrade exams are a combination of 3 separate MCTS/MCPD exams (&lt;a href="http://blogs.msdn.com/gerryo/archive/2009/02/02/status-update-on-exam-release-dates.aspx" target="_blank"&gt;Scroll down to Gerry's comment on the prep guides&lt;/a&gt;).&lt;/p&gt;  &lt;h2&gt;Background Reading&lt;/h2&gt;  &lt;p&gt;Before starting your study for the upgrade exam, I recommend you do some background reading on what is new in .NET 3.5 for ADO.NET, Windows Forms and ASP.NET. Here are some links to get you started:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb332048.aspx" target="_blank"&gt;What’s new in .NET Framework Version 3.5&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.dotnetcurry.com/ShowArticle.aspx?ID=96" target="_blank"&gt;What’s new in ASP.NET 3.5&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/s57a598e.aspx" target="_blank"&gt;What’s new in ASP.NET 3.5 (includes SP 1).&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/87sfaezs.aspx" target="_blank"&gt;What’s new in Data (LINQ etc)&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb762963.aspx" target="_blank"&gt;What’s new in Windows Forms for .NET framework 3.5&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Skills measured&lt;/h2&gt;  &lt;p&gt;This roughly ties up with the &lt;a href="http://www.microsoft.com/learning/en/us/Exams/70-568.aspx" target="_blank"&gt;skills measured page&lt;/a&gt; (as of 17th May 2009) on the MS site (the tabs don’t seem to work in the version of Firefox I use, so it is probably best to use IE to visit this page). The majority of the links point to MSDN, with a few linking to some excellent articles that I found. Of course this information is not 100% complete and subject to my own interpretation of the requirements. You should supplement the missing sections with your own Google search/book reading.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Configuring and Deploying Web Applications      &lt;ul&gt;       &lt;li&gt;Providers (I love the provider model, hence why there are so many links):          &lt;ol&gt;           &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms972319.aspx" target="_blank"&gt;Provider Model Design Pattern and Specification, Part 1&lt;/a&gt; (old but detailed). &lt;/li&gt;            &lt;li&gt;&lt;a href="http://download.microsoft.com/download/2/a/e/2aeabd28-3171-4b95-9363-22150625a6a5/ASP.NET%20Provider%20Model.pdf" target="_blank"&gt;The ASP.NET 2.0 Provider Model&lt;/a&gt;. 136 pages- a tomb of Provider Model information. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.configuration.provider.providerbase.aspx" target="_blank"&gt;ProviderBase&lt;/a&gt;- the base class for all provider implementations. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2006/11/20/common-gotcha-don-t-forget-to-clear-when-adding-providers.aspx" target="_blank"&gt;Don’t forget to add &amp;lt;clear/&amp;gt; when adding providers.&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.developer.com/net/asp/article.php/3569166" target="_blank"&gt;Configuring Providers&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb384297.aspx " target="_blank"&gt;Using the ASP.NET provider functionality in Windows based apps&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/f1kyba5e.aspx" target="_blank"&gt;Implementing a Membership Provider&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/8fw7xh74.aspx" target="_blank"&gt;Implementing a Role Provider&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/120705-1.aspx" target="_blank"&gt;Examining Membership, Roles and Profile&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/yy2ykkab.aspx" target="_blank"&gt;SiteMap&lt;/a&gt;- can use the Site-Map Provider. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://aspnet.4guysfromrolla.com/articles/020106-1.aspx" target="_blank"&gt;Creating a custom site map provider&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.odetocode.com/articles/440.aspx" target="_blank"&gt;Profiles in ASP.NET&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/0580x1f5.aspx" target="_blank"&gt;Implementing a Profile Provider&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.theserverside.net/tt/articles/content/CreatingProfileProvider/CreatingProfileProvider.html" target="_blank"&gt;Creating a custom DB profile provider&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa478952.aspx" target="_blank"&gt;Session State Providers&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178587.aspx" target="_blank"&gt;Implementing a Session-State Store Provider&lt;/a&gt;. &lt;/li&gt;         &lt;/ol&gt;       &lt;/li&gt;        &lt;li&gt;Authentication etc          &lt;ul&gt;           &lt;li&gt;I just read books for this section &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178581.aspx" target="_blank"&gt;Session State&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms178586.aspx" target="_blank"&gt;Session-State modes&lt;/a&gt;. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Consuming and Creating Server Controls      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://wiki.asp.net/page.aspx/475/comparing-listview-with-gridviewdatalist-and-repeater/" target="_blank"&gt;A great general comparison&lt;/a&gt; of controls. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/default.aspx" target="_blank"&gt;QuickStarts- data&lt;/a&gt; (.NET 2.0 but still handy as a refresher). &lt;/li&gt;        &lt;li&gt;&lt;a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/standard/default.aspx" target="_blank"&gt;QuickStarts- standard&lt;/a&gt;. (.NET 2.0 but still handy as a refresher). &lt;/li&gt;        &lt;li&gt;ListView- my personal favourite ASP.NET control.          &lt;ul&gt;           &lt;li&gt;&lt;a title="http://aspnet.4guysfromrolla.com/articles/122607-1.aspx" href="http://aspnet.4guysfromrolla.com/articles/122607-1.aspx"&gt;http://aspnet.4guysfromrolla.com/articles/122607-1.aspx&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a title="http://wiki.asp.net/page.aspx/475/comparing-listview-with-gridviewdatalist-and-repeater/" href="http://wiki.asp.net/page.aspx/475/comparing-listview-with-gridviewdatalist-and-repeater/"&gt;http://wiki.asp.net/page.aspx/475/comparing-listview-with-gridviewdatalist-and-repeater/&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a title="http://aspnet.4guysfromrolla.com/articles/010208-1.aspx" href="http://aspnet.4guysfromrolla.com/articles/010208-1.aspx"&gt;http://aspnet.4guysfromrolla.com/articles/010208-1.aspx&lt;/a&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;DataList- &lt;a href="https://aspalliance.com/1007_Building_and_Using_a_LINQ_for_SQL_Class_Library_with_ASPNET_20.6"&gt;https://aspalliance.com/1007_Building_and_Using_a_LINQ_for_SQL_Class_Library_with_ASPNET_20.6&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;TreeView- &lt;a title="http://msdn.microsoft.com/en-us/library/e8z5184w.aspx" href="http://msdn.microsoft.com/en-us/library/e8z5184w.aspx"&gt;http://msdn.microsoft.com/en-us/library/e8z5184w.aspx&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;@Register- &lt;a href="http://msdn.microsoft.com/en-us/library/c76dd5k1.aspx"&gt;http://msdn.microsoft.com/en-us/library/c76dd5k1.aspx&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;Templated ASP.NET user control          &lt;ul&gt;           &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/36574bf6.aspx"&gt;http://msdn.microsoft.com/en-us/library/36574bf6.aspx&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.itemplate.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.web.ui.itemplate.aspx&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.itemplate.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.web.ui.itemplate.aspx&lt;/a&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/5hbw267h.aspx" target="_blank"&gt;RequiredFieldValidator&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.comparevalidator.aspx" target="_blank"&gt;CompareValidator&lt;/a&gt; and &lt;a href="http://www.code5systems.com/Modules/FormMasterforDNN4/UserGuide/Validation/CompareValidator/tabid/224/Default.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/eahwtc9e.aspx" target="_blank"&gt;RegularExpressionValidator&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.4guysfromrolla.com/articles/073102-1.aspx" target="_blank"&gt;CustomValidator&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.aspx" target="_blank"&gt;Button&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.textbox.aspx" target="_blank"&gt;Textbox&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.dropdownlist.aspx" target="_blank"&gt;DropdownList&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.radiobutton.aspx" target="_blank"&gt;Radio Button&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.checkbox.aspx" target="_blank"&gt;CheckBox&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.hyperlink.aspx" target="_blank"&gt;HyperLink&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2006/02/21/438732.aspx" target="_blank"&gt;Wizard&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.multiview.aspx" target="_blank"&gt;MultiView&lt;/a&gt; and &lt;a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/standard/multiview.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Working with data and services.      &lt;ul&gt;       &lt;li&gt;No links for ADO.NET- I suggest you read a good book on the subject. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://andrewtokeley.net/archive/2008/07/10/the-difference-between-ldquoadd-web-referencerdquo-and-ldquoadd-service-referencerdquo.aspx" target="_blank"&gt;Add Web Reference vs. Add Service Reference.&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;Data Binding Syntax          &lt;ul&gt;           &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178366.aspx" target="_blank"&gt;Expressions overview&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://support.microsoft.com/kb/307860" target="_blank"&gt;Quick overview&lt;/a&gt;- the old way of doing things. &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Troubleshooting and debugging Web Applications.      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx" target="_blank"&gt;customErrors element&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.customerrorssection.redirectmode.aspx" target="_blank"&gt;CustomErrorsSection.RedirectMode&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2006/04/11/Don_1920_t-run-production-ASP.NET-Applications-with-debug_3D001D20_true_1D20_-enabled.aspx" target="_blank"&gt;&amp;lt;compilation debug=”true”&amp;gt;&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/s10awwz0.aspx" target="_blank"&gt;Compilation Element&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.asp.net/learn/3.5-videos/video-219.aspx" target="_blank"&gt;JavaScript debugging in VS.NET 2008 (Video).&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.microsoft.com/technet/scriptcenter/topics/ajax/chapter2.mspx" target="_blank"&gt;ASP.NET AJAX debugging&lt;/a&gt;- scroll to section 2.4.6. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/library/bb398817.aspx" target="_blank"&gt;Debugging and Tracing AJAX Applications overview&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb398933.aspx" target="_blank"&gt;Health monitoring overview&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms227553.aspx" target="_blank"&gt;How to send email for health monitoring notifications&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://odetocode.com/Blogs/scott/archive/2005/11/01/2402.aspx" target="_blank"&gt;Health monitoring in ASP.NET 2.0&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.asp.net/Learn/videos/video-195.aspx" target="_blank"&gt;Implementing health monitoring (Video)&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://madskristensen.net/post/Health-monitoring-in-ASPNET-20.aspx" target="_blank"&gt;Simple health monitoring email example&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://quickstart.developerfusion.co.uk/QuickStart/aspnet/doc/monitoring/webevents.aspx" target="_blank"&gt;Web events&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms998306.aspx#paght000011_step1" target="_blank"&gt;How to use health monitoring in ASP.NET 2.0&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/fxk122b4.aspx" target="_blank"&gt;Performance counters.&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b4d4d195-2ecb-4728-9348-6f1bfa1a1b63.mspx?mfr=true" target="_blank"&gt;Using perfmon&lt;/a&gt;. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Working with ASP.NET AJAX and Client-Side Scripting      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb386453.aspx#IntegratingClientScriptintoASP.NETWebApplications" target="_blank"&gt;The ScriptManager control&lt;/a&gt;.           &lt;ul&gt;           &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.enablepartialrendering.aspx" target="_blank"&gt;ScriptManager.EnablePartialRendering&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanager.services.aspx" target="_blank"&gt;Services&lt;/a&gt;- referencing. &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.scriptmanagerproxy.aspx" target="_blank"&gt;ScriptManagerProxy&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;Triggers          &lt;ul&gt;           &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.asyncpostbacktrigger.aspx" target="_blank"&gt;Async&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.postbacktrigger.aspx" target="_blank"&gt;Postback.&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/library/system.web.ui.updatepanel.childrenastriggers.aspx" target="_blank"&gt;ChildAsTriggers&lt;/a&gt;. &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/library/system.web.ui.scriptmanager.registerasyncpostbackcontrol.aspx" target="_blank"&gt;Wiring them up them programmatically.&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/library/system.web.ui.scriptmanager.registerpostbackcontrol.aspx" target="_blank"&gt;Excluding a control from async programmatically&lt;/a&gt;. &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb398785.aspx" target="_blank"&gt;Web Services in ASP.NET AJAX&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163499.aspx" target="_blank"&gt;Client side Web service calls with AJAX extensions&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb398995.aspx" target="_blank"&gt;Consuming Web Services from Client Script&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx" target="_blank"&gt;Page methods&lt;/a&gt; and &lt;a href="http://aspadvice.com/blogs/garbin/archive/2006/08/23/A-closer-look-at-Page-methods.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/library/system.web.ui.updateprogress.aspx" target="_blank"&gt;UpdateProgress&lt;/a&gt; and &lt;a href="http://www.codeproject.com/KB/ajax/UpdateProgress.aspx" target="_blank"&gt;here&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-gb/library/system.web.ui.timer.aspx" target="_blank"&gt;Timer Control&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb386417.aspx" target="_blank"&gt;AJAX Client lifecycle events&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://geekswithblogs.net/JuanDoNeblo/archive/2007/10/24/json_in_aspnetajax_part2.aspx" target="_blank"&gt;JSON&lt;/a&gt;. &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb310857.aspx" target="_blank"&gt;Sys.Serialization.JavaScriptSerializer&lt;/a&gt;. &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Targeting mobile devices (odd choice considering &lt;a href="http://blogs.msdn.com/webdevtools/archive/2007/09/17/tip-trick-asp-net-mobile-development-with-visual-studio-2008.aspx" target="_blank"&gt;VS.NET 2008 doesn’t have templates installed for it&lt;/a&gt;).       &lt;ul&gt;       &lt;li&gt;&lt;a href="http://www.asp.net/mobile/"&gt;http://www.asp.net/mobile/&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a title="http://blogs.msdn.com/webdevtools/archive/2007/09/17/tip-trick-asp-net-mobile-development-with-visual-studio-2008.aspx" href="http://blogs.msdn.com/webdevtools/archive/2007/09/17/tip-trick-asp-net-mobile-development-with-visual-studio-2008.aspx"&gt;http://blogs.msdn.com/webdevtools/archive/2007/09/17/tip-trick-asp-net-mobile-development-with-visual-studio-2008.aspx&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a title="http://geekswithblogs.net/ranganh/archive/2008/04/01/mobile-web-forms-in-visual-studio-2008.aspx" href="http://geekswithblogs.net/ranganh/archive/2008/04/01/mobile-web-forms-in-visual-studio-2008.aspx"&gt;http://geekswithblogs.net/ranganh/archive/2008/04/01/mobile-web-forms-in-visual-studio-2008.aspx&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a title="http://msdn.microsoft.com/en-us/library/system.web.ui.mobilecontrols.devicespecific.aspx" href="http://msdn.microsoft.com/en-us/library/system.web.ui.mobilecontrols.devicespecific.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.web.ui.mobilecontrols.devicespecific.aspx&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Programming Web Applications      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httprequest.aspx"&gt;Request- HttpRequest class&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httprequest_members.aspx"&gt;HttpRequest Members&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.aspx"&gt;Server- HttpServerUtility&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpapplicationstate.aspx"&gt;Application- HttpApplicationState&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.aspx"&gt;Session- HttpSessionState&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.aspx"&gt;Response- HttpResponse&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpcontext.aspx"&gt;HttpContext&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.regioninfo.aspx"&gt;RegionInfo&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;Accessibility improvements in ASP.NET 2.0          &lt;ul&gt;           &lt;li&gt;&lt;a href="http://www.15seconds.com/Issue/040727.htm"&gt;http://www.15seconds.com/Issue/040727.htm&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://www.15seconds.com/issue/040804.htm"&gt;http://www.15seconds.com/issue/040804.htm&lt;/a&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178231.aspx"&gt;TabIndex&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.image.alternatetext.aspx "&gt;AlternateText&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178233.aspx"&gt;AccessKey&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.image.generateemptyalternatetext.aspx"&gt;GenerateEmptyAlternateText&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.label.associatedcontrolid.aspx"&gt;Label.AssociatedControlID&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178581.aspx"&gt;Session State&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163901.aspx"&gt;ViewState&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms181007.aspx"&gt;Cookies&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178597.aspx"&gt;Caching&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178594.aspx"&gt;Application State&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178472.aspx"&gt;Page Events&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/y3bwdsh3.aspx"&gt;Control Events&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;Application Events:          &lt;ul&gt;           &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178473.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms178473.aspx&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb470252.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb470252.aspx&lt;/a&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178583.aspx"&gt;Session Events&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms178139.aspx"&gt;Cross Page Posting&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.redirect.aspx"&gt;Response.Redirect&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.transfer.aspx"&gt;Server.Transfer&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback.aspx"&gt;Page.IsPostBack&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.pagessection.autoeventwireup.aspx"&gt;AutoEventWireup&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Creating a UI for a Windows Forms Application by Using Standard Controls      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.menustrip.aspx"&gt;MenuStrip&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.contextmenustrip.aspx"&gt;ContextMenuStrip&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms171542.aspx"&gt;Mouse events in Windows Forms&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Integrating Data in a Windows Forms Application      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.aspx"&gt;DataGridView- replaces the functionality of the DataGrid in .NET 2.0+&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/c8aebh9k.aspx"&gt;Databinding and Windows Forms&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/b63ha24w.aspx"&gt;Navigating data (binding source)&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/2wcswths.aspx"&gt;BindingNavigator&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.aspx "&gt;DataConnector- assumes they mean BindingSource&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.transactions.transaction.aspx"&gt;Transaction Class&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.dataset.aspx"&gt;DataSet&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/dbwcse3d.aspx"&gt;Relationships in Datasets&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.dataset.relations.aspx"&gt;DataSet.Relations&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.aspx"&gt;DataTable&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aszytsd8.aspx"&gt;Merging DataSet Contents&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.dataset.copy.aspx"&gt;DataSet.Copy&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/esbykkzb.aspx"&gt;Typed DataSets&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/84sxtbxh.aspx"&gt;Using XML in a DataSet&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/fx29c3yd.aspx"&gt;Loading a DataSet from XML&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/zx8h06sz.aspx"&gt;Writing DataSet contents as XML data&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/tf579hcz.aspx"&gt;CommandBuilder&lt;/a&gt;- also see &lt;a href="http://msdn.microsoft.com/en-us/library/ms971491.aspx"&gt;Weaning developers from the CommandBuilder&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.data.common.dataadapter.aspx"&gt;DataAdapter&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/6d1wk41s.aspx"&gt;DataAdapter Events&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aadf8fk2.aspx"&gt;Performing batch operations using DataAdapters&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Implementing Printing and Reporting Functionality in a Windows Forms Application      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.printdialog.aspx"&gt;PrintDialog&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/se805s02.aspx"&gt;PrintDocument&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.printpreviewdialog.aspx"&gt;PrintPreviewDialog&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.pagesetupdialog.aspx"&gt;PageSetupDialog&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.drawing.printing.printdocument.endprint.aspx"&gt;PrintDocument.EndPrint&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Enhancing Usability      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/5839we2z.aspx"&gt;Localization&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/c08a467e.aspx"&gt;Globalization&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/9xdxwwkc.aspx"&gt;Globalizing Windows Forms&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.aspx"&gt;CultureInfo class&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.getcultures.aspx"&gt;CultureInfo.GetCultures&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.globalization.culturetypes.aspx"&gt;CultureTypes&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/xyhh2e7e.aspx"&gt;MDI applications&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/ms404314.aspx"&gt;menu merging for MDI applications&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/55dct0a1.aspx"&gt;Help systems in Windows Forms applications&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.helpprovider.aspx "&gt;HelpProvider Class&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.aspx"&gt;Tooltip component&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/wxbk7hac.aspx"&gt;Popup Help&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.propertygrid.aspx"&gt;PropertyGrid Class&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.progressbar.aspx"&gt;ProgressBar&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms229738.aspx"&gt;StatusStrip&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.errorprovider.aspx"&gt;ErrorProvider&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://www.angelosp.com/blog/post/Which-timer-class-to-use.aspx"&gt;Which timer class to use&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.threading.timer.aspx"&gt;Threading Timer&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx"&gt;System.Timers.Timer&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.timer.aspx"&gt;Windows Forms Timer&lt;/a&gt;- single threaded, accuracy of 55ms &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Implementing Asynchronous Programming Techniques      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx"&gt;Background Worker&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker.isbusy.aspx"&gt;Request Status&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Deploying Windows Forms Controls      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/5t70dw29.aspx"&gt;Developing a Composite Windows Forms Control&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/3sf86w5h.aspx"&gt;How to author Composite Controls&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/9yxtkx75.aspx"&gt;Display Control in Customize Toolbox Dialog Box&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/4wk1wc0a.aspx"&gt;Provide a Toolbox Bitmap for a control&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.drawing.toolboxbitmapattribute.aspx"&gt;ToolboxBitmapAttribute&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.onpaint.aspx"&gt;Control.OnPaint&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/02a1w7dy.aspx"&gt;Expose Properties of Constituent Controls&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.control.visible.aspx"&gt;Control.Visible&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Configuring and Deploying Applications      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/wh45kb66.aspx"&gt;ClickOnce Deployment for Windows Forms Applications&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.deployment.application.aspx"&gt;System.Deployment.Application namespace&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/01daf08f.aspx"&gt;Trusted Application Deployment Overview- using certificates instead of prompting users for elevation&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms404263.aspx"&gt;How to check for updates programmatically&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb384098.aspx"&gt;ClickOnce deployments on Vista&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/syyw4edd.aspx"&gt;Add icons during setup&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aak1cze8.aspx"&gt;Set Conditional Installation Based on Operating System Versions&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa370556.aspx"&gt;Codes for the various OS versions&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ay12wede.aspx"&gt;Launch conditions&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/d9k65z2d.aspx"&gt;Custom Action walkthrough&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/xc8bz3y5.aspx"&gt;Error Handling in Custom Actions&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/a0ke3k86.aspx"&gt;Using caspol to modify the security policy&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.security.accesscontrol.aspx"&gt;System.Security.AccessControl&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Selecting and Querying Data      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms345135.aspx#mandataac_topic6"&gt;Managed Data Access Inside SQL Server with ADO.NET and SQLCLR&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb383977.aspx"&gt;Extension Methods&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb351562.aspx"&gt;IQueryable&amp;lt;T&amp;gt;&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/library/9eekhta0.aspx"&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://innovativesingapore.com/blogs/jocelyn/archive/2007/10/02/iqueryable-vs-ienumerable.aspx"&gt;IQueryable vs IEnumerable&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/tcbchxcb.aspx"&gt;Snapshot Isolation in SQL Server&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb384567.aspx"&gt;Hierarchical updates&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb394939.aspx"&gt;The.NET standard query operators&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;LINQ Operators          &lt;ul&gt;           &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb397941.aspx "&gt;Inner Join&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb397895.aspx"&gt;Left Outer Join&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb355235.aspx"&gt;Like&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb534297.aspx"&gt;Group Join&lt;/a&gt; &lt;/li&gt;            &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb534336.aspx"&gt;SelectMany&lt;/a&gt; &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;The official books&lt;/h2&gt;  &lt;p&gt;You might want to get the official MS Press books to help you study for this exam. I didn’t, as I choose to read non MS books instead- for that reason I don’t have an opinion of them. For completeness, these are what I believe to be the official MS Press books for the components that make up the exam:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/073562562X/myblo02-21" target="_blank"&gt;MCTS Self Paced Training Kit (Exam 70-562 – ASP.NET).&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735626375/myblo02-21" target="_blank"&gt;MCTS Self-Paced Training Kit(Exam 70-505 - Windows Forms).&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735625638/myblo02-21" target="_blank"&gt;MCTS Self-Paced Training Kit(Exam 70-561 - ADO.NET).&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Unfortunately I can’t find any sample chapters for these books- from the reviews it looks like they may be useful for exam, particularly for candidates with little experience.&lt;/p&gt;  &lt;h2&gt;The books I used/think are useful&lt;/h2&gt;  &lt;p&gt;I read a lot of tech books in order to try and stay up-to-date with technology, so I didn’t read all of these books just to pass the exam. Also if like me you have access to &lt;a href="http://my.safaribooksonline.com/" target="_blank"&gt;O’Reilly Safari&lt;/a&gt;, then you can read some of these books on there.&lt;/p&gt;  &lt;h3&gt;ASP.NET books&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/1933988142/myblo02-21" target="_blank"&gt;ASP.NET AJAX in action&lt;/a&gt; (this is a .NET 2.0 book but still mostly relevant). A very good book, but unfortunately out of date. I still found it very useful both for the exam and using ASP.NET AJAX. You also might want to consider &lt;a href="http://www.amazon.com/exec/obidos/ASIN/0470392177/myblo02-21" target="_blank"&gt;Professional ASP.NET 3.5 AJAX&lt;/a&gt;, as this targets ASP.NET 3.5- I didn’t buy it, but if I was looking for a book now I would probably favour this one over the “in action” range, simple because it is out of date. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0470187573/myblo02-21" target="_blank"&gt;Professional ASP.NET 3.5&lt;/a&gt;. This is a nice easy to read book on ASP.NET 3.5. It would probably be most useful for people who haven’t done much ASP.NET, but have some .NET experience. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321237706/myblo02-21" target="_blank"&gt;Essential ASP.NET 2.0&lt;/a&gt;. Brilliant chapter on Health Monitoring and Web events- the chapter is called Diagnostics. This book looks like it aimed at more experienced ASP.NET developers. I only read the chapter on diagnostics, but the rest of it looks interesting. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735625271/myblo02-21" target="_blank"&gt;Programming Microsoft ASP.NET 3.5&lt;/a&gt;. Good coverage of authorization and authentication. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0596529562/myblo02-21"&gt;Programming ASP.NET 3.5, 4th edition&lt;/a&gt;. Another book with good coverage of authentication and impersonation. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;LINQ&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/1590597893/myblo02-21" target="_blank"&gt;Pro LINQ: Language Integrated Query in C# 2008.&lt;/a&gt; This book got me up-to-speed with LINQ and was very useful for both the exam and my daily development tasks. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;Windows Forms&lt;/h3&gt;  &lt;p&gt;I didn’t use a Windows forms book to study for the exam, but I can recommend this one:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0321267966/myblo02-21" target="_blank"&gt;Windows Forms 2.0 Programming (2nd Edition).&lt;/a&gt; There doesn’t seem to be any alternative to the MS-Press study books for Windows Forms 3.5- maybe authors are targeting WPF instead. &lt;/li&gt; &lt;/ul&gt;  &lt;h3&gt;ADO.NET&lt;/h3&gt;  &lt;p&gt;I didn’t buy any specific books on ADO.NET. However I know this framework exceptionally well, as it use it on virtually every project I work on. A book I found useful when upgrading to .NET 2.0 was:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/073562206X/myblo02-21" target="_blank"&gt;Programming Microsoft ADO.NET Core Reference&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;A book that looks like it could be very good is &lt;a href="http://www.amazon.com/exec/obidos/ASIN/047018261X/myblo02-21" target="_blank"&gt;“Professional ADO.NET 3.5”,&lt;/a&gt; though I’ve not read it myself.&lt;/p&gt;  &lt;h3&gt;General .NET&lt;/h3&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735621632/myblo02-21"&gt;CLR via C#&lt;/a&gt;. This is the one book I recommend to any .NET programmer. For the exam it has an excellent chapter on performing asynchronous operations. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Of course you don’t have to use books at all (or you might not have the budget to buy books), in that case the next section is the most useful.&lt;/p&gt;  &lt;h2&gt;Extra stuff&lt;/h2&gt;  &lt;p&gt;You don’t need to this stuff for the exam, but I stumbled across it whilst revising.&lt;/p&gt;  &lt;p&gt;Completely off topic, but I found it interesting- distributed caching:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://en.wikipedia.org/wiki/Memcached" target="_blank"&gt;MemCached&lt;/a&gt;. See &lt;a href="http://www.codeplex.com/memcachedproviders" target="_blank"&gt;Memcached Session State and Cache Providers for ASP.NET&lt;/a&gt;- I haven’t it but it looks interesting. &lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=B24C3708-EEFF-4055-A867-19B5851E7CD2&amp;amp;displaylang=en#QuickInfoContainer" target="_blank"&gt;Microsoft Velocity&lt;/a&gt; and &lt;a href="http://msdn.microsoft.com/en-us/data/cc655792.aspx" target="_blank"&gt;Microsoft Project Code Name “Velocity”&lt;/a&gt;. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Other interesting stuff:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.codeproject.com/KB/aspnet/Log4NetWebEventProvider.aspx" target="_blank"&gt;Using health monitoring with log4net&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Session wrapper- makes it more testable- designed for ASP.NET MVC:      &lt;ul&gt;       &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpsessionstatewrapper.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.web.httpsessionstatewrapper.aspx&lt;/a&gt; &lt;/li&gt;        &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpsessionstatebase.aspx"&gt;http://msdn.microsoft.com/en-us/library/system.web.httpsessionstatebase.aspx&lt;/a&gt; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Finally there is lots of useful programming information on &lt;a href="http://stackoverflow.com/"&gt;Stackoverflow&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-615870333140101197?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/615870333140101197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/05/microsoft-70-568-exam-study-guide.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/615870333140101197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/615870333140101197'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/05/microsoft-70-568-exam-study-guide.html' title='Microsoft 70-568 exam study guide'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-465639103579202179</id><published>2009-04-21T18:57:00.002+01:00</published><updated>2009-04-21T19:00:54.945+01:00</updated><title type='text'>Top Gear Filming in Canary Wharf</title><content type='html'>&lt;p&gt;Sorry to disappoint- a non technical post!&lt;/p&gt;  &lt;p&gt;Today the &lt;a href="http://www.topgear.com" target="_blank"&gt;Top Gear&lt;/a&gt; team were in Canary Wharf and I managed to take some poor quality photos on my mobile- if only I had my SLR! Luckily I managed to make them a little better by using Photoshop Elements.&lt;/p&gt;  &lt;p&gt;Clarkson inspecting a car:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_S3YrXat7Lwo/Se4I8aAVjGI/AAAAAAAAACg/hl9n4sSUhH0/s1600-h/topgear-3%5B5%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="topgear-3" border="0" alt="topgear-3" src="http://lh4.ggpht.com/_S3YrXat7Lwo/Se4I9C7tRVI/AAAAAAAAACk/vRpDOk7gxL0/topgear-3_thumb%5B3%5D.jpg?imgmax=800" width="644" height="484" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;  &lt;p&gt;Hammond and May inspecting a car:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_S3YrXat7Lwo/Se4I9iB9kcI/AAAAAAAAACo/h8t2s1h1d_o/s1600-h/topgear-2%5B6%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="topgear-2" border="0" alt="topgear-2" src="http://lh4.ggpht.com/_S3YrXat7Lwo/Se4I-NY1tVI/AAAAAAAAACs/I1wLfmbTmF4/topgear-2_thumb%5B4%5D.jpg?imgmax=800" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The trio looking at the assembled crowd:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_S3YrXat7Lwo/Se4I-oa6zCI/AAAAAAAAACw/cLalVTzHrSY/s1600-h/topgear-4%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="topgear-4" border="0" alt="topgear-4" src="http://lh5.ggpht.com/_S3YrXat7Lwo/Se4I_csdtCI/AAAAAAAAAC0/cIjQCrekayQ/topgear-4_thumb%5B1%5D.jpg?imgmax=800" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Clarkson asking the crowd if anyone is a banker:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_S3YrXat7Lwo/Se4I_yS9BKI/AAAAAAAAAC4/7Mi2nvs7LH8/s1600-h/topgear-5%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="topgear-5" border="0" alt="topgear-5" src="http://lh3.ggpht.com/_S3YrXat7Lwo/Se4JAqjqMKI/AAAAAAAAAC8/Ff3va2YrAYM/topgear-5_thumb%5B1%5D.jpg?imgmax=800" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It was amazing how many people “worked” for the FSA when Clarkson asked them this question!&lt;/p&gt;  &lt;p&gt;James May talking to people in the crowd:&lt;br&gt;&lt;a href="http://lh5.ggpht.com/_S3YrXat7Lwo/Se4JBI5WIVI/AAAAAAAAADA/tqA0IVJuxiQ/s1600-h/topgear-7%5B3%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="topgear-7" border="0" alt="topgear-7" src="http://lh4.ggpht.com/_S3YrXat7Lwo/Se4JB7hmjKI/AAAAAAAAADE/nc3MR9q92ls/topgear-7_thumb%5B1%5D.jpg?imgmax=800" width="644" height="484" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Looks like someone else beat me to it &lt;a href="http://finkangel.blogspot.com/2009/04/top-gear-filming-canary-wharf.html" target="_blank"&gt;putting pictures on the Internet&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-465639103579202179?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/465639103579202179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/04/top-gear-filming-in-canary-wharf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/465639103579202179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/465639103579202179'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/04/top-gear-filming-in-canary-wharf.html' title='Top Gear Filming in Canary Wharf'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_S3YrXat7Lwo/Se4I9C7tRVI/AAAAAAAAACk/vRpDOk7gxL0/s72-c/topgear-3_thumb%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-4063048242278282896</id><published>2009-04-20T20:55:00.001+01:00</published><updated>2009-04-20T20:55:21.039+01:00</updated><title type='text'>The Obsolete Attribute</title><content type='html'>&lt;p&gt;Today a former co-worker asked me “what was that attribute we used to mark something as deprecated?” After a little pause for thought I remembered it was the &lt;a href="http://msdn.microsoft.com/en-us/library/system.obsoleteattribute.aspx" target="_blank"&gt;ObsoleteAttribute&lt;/a&gt;- It’s a shame Microsoft hadn’t named this DeprecatedAttribute instead- this is what the &lt;a href="http://java.sun.com/javase/6/docs/api/java/lang/Deprecated.html" target="_blank"&gt;annotation is called in Java&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I had previously used this attribute whilst in the middle of a large refactoring exercise on a project, where other developers were working on existing classes. It served as a useful reminder to start calling the new method, without breaking the build/their code/unit tests (we had a team culture where we would address warnings as soon as we noticed them). After all the consumer classes had been modified to use the new code, I searched for “Obsolete” in the code and discovered that the previous development team (the project was initially outsourced) had been using comments to mark code as deprecated- so perhaps not many people know about this useful attributes existence?&lt;/p&gt;  &lt;p&gt;By default the attribute generates a compiler warning when a program element is referred to in a consumer class. This is the way I had used the attribute previously with a textual description describing how to correct the warning. Indeed a first glance at the documentation for the class (see &lt;a href="http://msdn.microsoft.com/en-us/library/aa664623.aspx" target="_blank"&gt;here in the C# language specification&lt;/a&gt;, and &lt;a href="http://msdn.microsoft.com/en-us/library/system.obsoleteattribute.aspx" target="_blank"&gt;here in the MSDN library&lt;/a&gt;)&amp;#160; suggests this is all this attribute can do:&lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ObsoleteOne();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #2b91af"&gt;Obsolete&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Use the BetterMethod instead&amp;quot;&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ObsoleteOne()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;This is a bad method&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; BetterMethod()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;This is a better method&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Used in this manner, the attribute will caused a warning to be generated like so:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_S3YrXat7Lwo/SezTHbXr1HI/AAAAAAAAACI/K9jWulKA8NE/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_S3YrXat7Lwo/SezTH_L7j1I/AAAAAAAAACM/CTvLOZdoaQQ/image_thumb%5B1%5D.png?imgmax=800" width="767" height="237" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In our discussion on using the attribute my former co-worker pointed out that the attribute can also be used to create a compiler error, simply by changing the code to (notice the 2nd boolean parameter):&lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; [&lt;span style="color: #2b91af"&gt;Obsolete&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;Use the BetterMethod instead&amp;quot;&lt;/span&gt;, &lt;span style="color: blue"&gt;true&lt;/span&gt;)]&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; ObsoleteOne()&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;This is a bad method&amp;quot;&lt;/span&gt;);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;This will result in a compiler error as follows:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_S3YrXat7Lwo/SezTIndq1UI/AAAAAAAAACQ/RePK3ge83KY/s1600-h/image%5B7%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_S3YrXat7Lwo/SezTI6sqRlI/AAAAAAAAACU/5RMsOAGB3HE/image_thumb%5B3%5D.png?imgmax=800" width="767" height="237" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In my project I didn’t use this- when references to the old code were removed, I simply removed the obsolete methods. In an API which you distribute to multiple consumers, you obviously don’t have that luxury, and I can see this overload being useful. It is important to remember that this attribute is useful for classes, structs, enums, constructors, properties, fields, events, interfaces or delegates as well as methods.&lt;/p&gt;  &lt;p&gt;Sun’s (&lt;a href="http://news.bbc.co.uk/1/hi/business/8008246.stm" target="_blank"&gt;or should I say Oracle’s&lt;/a&gt;) Java documentation provides some useful insight as to &lt;a href="http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/deprecation/deprecation.html#when" target="_blank"&gt;when you should deprecate code&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;When deprecating it is important to suggest how developers using your code should fix the issue. For example if you use the deprecated class System.Web.Mail.MailMessage, you will receive the following useful compiler warning:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_S3YrXat7Lwo/SezTJngsnKI/AAAAAAAAACY/kJfQ8xzPQJA/s1600-h/image%5B11%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_S3YrXat7Lwo/SezTJ9KqsfI/AAAAAAAAACc/4gMIXMTFLg0/image_thumb%5B5%5D.png?imgmax=800" width="767" height="237" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This tells the consumer that the method is obsolete, what the recommended alternative is and where to go to find further help- which unfortunately in this case seems to &lt;a href="http://msdn.microsoft.com/en-gb/netframework/default.aspx" target="_blank"&gt;redirect to a generic .NET Framework page&lt;/a&gt; (woops)! I’m sure any competent developer can quickly work out that they should use &lt;a href="http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx" target="_blank"&gt;System.Net.Mail.MailMessage&lt;/a&gt; instead though!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-4063048242278282896?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/4063048242278282896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/04/obsolete-attribute.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/4063048242278282896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/4063048242278282896'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/04/obsolete-attribute.html' title='The Obsolete Attribute'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_S3YrXat7Lwo/SezTH_L7j1I/AAAAAAAAACM/CTvLOZdoaQQ/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-4147767031453054160</id><published>2009-04-17T21:16:00.001+01:00</published><updated>2009-04-17T21:16:34.594+01:00</updated><title type='text'>Excellent Slides on unit testing</title><content type='html'>&lt;p&gt;Today I stumbled across some excellent &lt;a href="http://www.masukomi.org/talks/unit_testing_talk_2/index.xul?data=slide_data.txt" target="_blank"&gt;slides on unit testing&lt;/a&gt;. Unfortunately they only appear to be viewable in Firefox, but they are certainly worth viewing. They cover a lot of ground including the reason for &lt;a href="http://xunitpatterns.com/Mock%20Object.html" target="_blank"&gt;mock objects&lt;/a&gt; and an excellent explanation on the differences between &lt;a href="http://en.wikipedia.org/wiki/Unit_testing" target="_blank"&gt;unit testing&lt;/a&gt; and &lt;a href="http://en.wikipedia.org/wiki/Integration_testing" target="_blank"&gt;integration testing&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;I’m also enjoying looking at &lt;a href="http://stackoverflow.com/" target="_blank"&gt;stackoverflow&lt;/a&gt;- this site is an excellent resource for programmers, it is also an excellent example of what can be achieved with &lt;a href="http://www.asp.net/mvc/" target="_blank"&gt;ASP.NET MVC&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-4147767031453054160?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/4147767031453054160/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/04/excellent-slides-on-unit-testing.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/4147767031453054160'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/4147767031453054160'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/04/excellent-slides-on-unit-testing.html' title='Excellent Slides on unit testing'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-7269045689526401419</id><published>2009-04-08T21:03:00.001+01:00</published><updated>2009-04-08T21:03:32.836+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='performance tuning'/><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><title type='text'>Break execution on all exceptions</title><content type='html'>&lt;p&gt;A colleague of mine informed me that she had been working on a hard to track down bug in an application written by another developer. After some investigation she discovered the bug was caused by invalid logic created by an exception that the original developer had decided to swallow.&lt;/p&gt;  &lt;p&gt;This scenario is quite common and is documented as a common source of bugs in the excellent book &lt;a href="http://www.amazon.co.uk/gp/product/0735622027?ie=UTF8&amp;amp;tag=myblo02-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=6738&amp;amp;creativeASIN=0735622027" target="_blank"&gt;Debugging Microsoft .NET 2.0 Applications&lt;/a&gt; by &lt;a href="http://www.wintellect.com/CS/blogs/jrobbins/default.aspx" target="_blank"&gt;John Robbins&lt;/a&gt;. It would probably be better if the debugger breaks on all exceptions by default with &lt;a href="http://msdn.microsoft.com/en-us/library/h5e30exc.aspx" target="_blank"&gt;Just My Code&lt;/a&gt;, that way those hidden bugs would become more apparent during development.&lt;/p&gt;  &lt;p&gt;In order to get the debugger to break on all CLR exceptions &lt;a href="http://msdn.microsoft.com/en-us/library/d14azbfh.aspx" target="_blank"&gt;all you need to do&lt;/a&gt; is the following:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;From the &lt;em&gt;Debug Menu&lt;/em&gt; choose &lt;em&gt;Exceptions or CTRL-ALT-E (screenshot from VS.NET 2008)&lt;/em&gt;: &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_S3YrXat7Lwo/Sd0DEBtW97I/AAAAAAAAACA/cbE2as_MMf4/s1600-h/image%5B3%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh6.ggpht.com/_S3YrXat7Lwo/Sd0DEyy1coI/AAAAAAAAACE/2j4pr3bx6a0/image_thumb%5B1%5D.png?imgmax=800" width="739" height="374" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Select &lt;em&gt;Thrown &lt;/em&gt;for all CLR exceptions or expand the tree view to only break on specific exceptions. You can then debug your app and hopefully (if it is well written), the debugger shouldn’t normally hit anything that isn’t a breakpoint!&lt;/p&gt;  &lt;p&gt;This Visual Studio debugger feature is useful for a number of scenarios, notably:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Ensuring that the application is not catching &lt;a href="http://msdn.microsoft.com/en-us/library/ms182137.aspx" target="_blank"&gt;overly general exceptions&lt;/a&gt;. &lt;/li&gt;    &lt;li&gt;Locating difficult to detect bugs (these can also be caused by 1). &lt;/li&gt;    &lt;li&gt;Optimizing performance. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Of these 3 scenarios optimizing performance is worth discussing. When I first learnt about this feature, I tried it out on a large application that I was assigned the task of maintaining (disclaimer- I wasn’t in the original programming team :-). &lt;/p&gt;  &lt;p&gt;The application was a .NET 1.1 application (I was in the process of upgrading to 2.0- as I always strive to &lt;a href="http://mikehadlow.blogspot.com/2009/04/why-you-should-upgrade-to-visual-studio.html" target="_blank"&gt;upgrade to the latest available framework/toolset&lt;/a&gt; where possible/feasible) that conceptually did something along the lines of:&lt;/p&gt;  &lt;div style="font-family: courier new; background: white; color: black; font-size: 10pt"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt; hopefullyANumber;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: green"&gt;// Assign the string from somewhere...&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;int&lt;/span&gt; result = 0;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;try&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; result = &lt;span style="color: blue"&gt;int&lt;/span&gt;.Parse(hopefullyANumber);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt;)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: green"&gt;// Swallow&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;return&lt;/span&gt; result;&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;This code would not of caused any real performance issues, were it not for the fact that it was being called over and over thousands of times!&lt;/p&gt;  &lt;p&gt;Admittedly the original developers didn’t have access to &lt;a href="http://msdn.microsoft.com/en-us/library/system.int32.tryparse.aspx" target="_blank"&gt;Int32.TryParse&lt;/a&gt; (but they could of used other techniques such as regular expressions), however after modifying the code so that it used TryParse I managed to reduce the CPU usage of the application by over 20% (I profiled it before and after with &lt;a href="http://www.jetbrains.com/profiler/" target="_blank"&gt;dotTRACE&lt;/a&gt;)!&lt;/p&gt;  &lt;p&gt;It is good practise to see if the &lt;a href="http://blogs.msdn.com/kcwalina/archive/2005/03/16/396787.aspx" target="_blank"&gt;TryParse or Tester-Doer pattern&lt;/a&gt; can be of benefit to the performance of your application.&lt;/p&gt;  &lt;p&gt;In summary having the debugger break on all exceptions in applications is a useful technique to catch bugs early in development, to check for over generalized exception handling or to enhance performance.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-7269045689526401419?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/7269045689526401419/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/04/break-execution-on-all-exceptions.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/7269045689526401419'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/7269045689526401419'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/04/break-execution-on-all-exceptions.html' title='Break execution on all exceptions'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_S3YrXat7Lwo/Sd0DEyy1coI/AAAAAAAAACE/2j4pr3bx6a0/s72-c/image_thumb%5B1%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-2887782389579049106</id><published>2009-03-24T21:23:00.001Z</published><updated>2009-03-24T21:23:31.481Z</updated><title type='text'>Visual Studio GridView Designer Fix</title><content type='html'>&lt;p&gt;In a &lt;a href="http://richardod.blogspot.com/2009/03/visual-studio-2008-aspnet-designer-bug.html" target="_blank"&gt;previous post&lt;/a&gt;, I blogged about a bug with VS.NET 2008 designer. I’m pleased to discover this problem has &lt;a href="http://connect.microsoft.com/VisualStudio/Downloads/DownloadDetails.aspx?DownloadID=17185" target="_blank"&gt;now been fixed&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-2887782389579049106?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/2887782389579049106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/03/visual-studio-gridview-designer-fix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/2887782389579049106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/2887782389579049106'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/03/visual-studio-gridview-designer-fix.html' title='Visual Studio GridView Designer Fix'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-6906885868698193444</id><published>2009-03-15T13:27:00.001Z</published><updated>2009-03-15T13:27:52.943Z</updated><title type='text'>Using LINQ Dynamic Query Library with the ObjectDataSource</title><content type='html'>&lt;p&gt;Recently I stumbled across the Dynamic Query Library for LINQ, which comes as part of the &lt;a href="http://msdn.microsoft.com/en-us/vcsharp/bb894665.aspx" target="_blank"&gt;Visual C# 2008 examples&lt;/a&gt;. Scott Gu has blogged about &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/01/07/dynamic-linq-part-1-using-the-linq-dynamic-query-library.aspx" target="_blank"&gt;using the Dynamic Query Library with LINQ to SQL&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;In this post, I show an example of using it with the &lt;a href="http://msdn.microsoft.com/en-us/library/9a4kyhcx.aspx" target="_blank"&gt;ObjectDataSource&lt;/a&gt; Web Server Control in ASP.NET.&lt;/p&gt;  &lt;p&gt;The requirement is to display a grid in ASP.NET that allows sorting via the middle tier. Here is an example of the GUI (clicking on the headers sorts the data).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_S3YrXat7Lwo/Sb0CVgyGtGI/AAAAAAAAAB4/gE7SIg8P7MU/s1600-h/image%5B6%5D.png"&gt;&lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="243" alt="image" src="http://lh5.ggpht.com/_S3YrXat7Lwo/Sb0CWNrXv3I/AAAAAAAAAB8/-IyQOqQGgaE/image_thumb%5B2%5D.png?imgmax=800" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;For our example, we will bind to the following business object (Made as simple as possible, &lt;a href="http://www.danielmoth.com/Blog/2007/03/automatic-properties-in-c3.html" target="_blank"&gt;using automatic properties&lt;/a&gt;):&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;int&lt;/span&gt; Age { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; FirstName { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt; LastName { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;We then need to write a class to to get the data and apply the sorting (in a proper application this might be done across two tiers). To make the code as short as possible, I have used C# 3.0 &lt;a href="http://www.blackwasp.co.uk/CSharpObjectInitialisers.aspx" target="_blank"&gt;Object Initialisers&lt;/a&gt; and &lt;a href="http://www.blackwasp.co.uk/CSharpCollectionInits.aspx" target="_blank"&gt;Collection Initialisers&lt;/a&gt;.&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;FakeDb&lt;/span&gt;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;public&lt;/span&gt; &lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&amp;gt; GetPeople(&lt;span style="color: blue"&gt;string&lt;/span&gt; sortExpression)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&amp;gt; persons = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Person&lt;/span&gt;&amp;gt;(3) &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; { Age = 10, FirstName = &lt;span style="color: #a31515"&gt;&amp;quot;Richard&amp;quot;&lt;/span&gt;, LastName = &lt;span style="color: #a31515"&gt;&amp;quot;Smith&amp;quot;&lt;/span&gt; },&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; { Age = 34, FirstName = &lt;span style="color: #a31515"&gt;&amp;quot;Bob&amp;quot;&lt;/span&gt;, LastName = &lt;span style="color: #a31515"&gt;&amp;quot;Jones&amp;quot;&lt;/span&gt; },&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; { Age = 50, FirstName = &lt;span style="color: #a31515"&gt;&amp;quot;Lisa&amp;quot;&lt;/span&gt;, LastName = &lt;span style="color: #a31515"&gt;&amp;quot;Jones&amp;quot;&lt;/span&gt; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; };&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if&lt;/span&gt; (!&lt;span style="color: blue"&gt;string&lt;/span&gt;.IsNullOrEmpty(sortExpression))&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; persons = persons.AsQueryable().OrderBy(sortExpression).ToList();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;return&lt;/span&gt; persons;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;The line to note is the line using the dynamic query extension methods:&lt;/p&gt;  &lt;div style="font-size: 10pt; background: white; color: black; font-family: courier new"&gt;   &lt;p style="margin: 0px"&gt;people = people.AsQueryable().OrderBy(sortExpression).ToList();&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;To allow the List to use this extension method, we first need to convert the List to IQueryable, which is achieved using the &lt;a href="http://msdn.microsoft.com/en-us/library/bb353734.aspx" target="_blank"&gt;AsQueryable extension method&lt;/a&gt;. We then apply the Dynamic Query Extension OrderBy, which takes the name of the property to sort on and the sort direction- for example “Age DESC”. We then convert the IQueryable result back to a List and return it.&lt;/p&gt;  &lt;p&gt;We then just need the following in our ASPX (formatting attributes have been removed):&lt;/p&gt;  &lt;p&gt;&amp;lt;asp:GridView ID=&amp;quot;grdViewPersons&amp;quot; runat=&amp;quot;server&amp;quot; AllowSorting=&amp;quot;True&amp;quot;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AutoGenerateColumns=&amp;quot;False&amp;quot; DataSourceID=&amp;quot;objSrcFakeData&amp;quot; &amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Columns&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:BoundField DataField=&amp;quot;Age&amp;quot; HeaderText=&amp;quot;Age&amp;quot; SortExpression=&amp;quot;Age&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:BoundField DataField=&amp;quot;FirstName&amp;quot; HeaderText=&amp;quot;FirstName&amp;quot;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SortExpression=&amp;quot;FirstName&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:BoundField DataField=&amp;quot;LastName&amp;quot; HeaderText=&amp;quot;LastName&amp;quot;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SortExpression=&amp;quot;LastName&amp;quot; /&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Columns&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/asp:GridView&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:ObjectDataSource ID=&amp;quot;objSrcFakeData&amp;quot; runat=&amp;quot;server&amp;quot;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SelectMethod=&amp;quot;GetPeople&amp;quot; TypeName=&amp;quot;DynamicQuerySorting.FakeDb&amp;quot; SortParameterName=&amp;quot;sortExpression&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/asp:ObjectDataSource&amp;gt;&lt;/p&gt;  &lt;p&gt;This code makes sorting a breeze! You can also use Dynamic Query sorting if you are using databinding, by hooking into the &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sorting.aspx" target="_blank"&gt;GridView.Sorting Event&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-6906885868698193444?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/6906885868698193444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/03/using-linq-dynamic-query-library-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/6906885868698193444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/6906885868698193444'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/03/using-linq-dynamic-query-library-with.html' title='Using LINQ Dynamic Query Library with the ObjectDataSource'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_S3YrXat7Lwo/Sb0CWNrXv3I/AAAAAAAAAB8/-IyQOqQGgaE/s72-c/image_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-8164017386356827935</id><published>2009-03-14T15:45:00.003Z</published><updated>2009-05-18T08:46:41.764+01:00</updated><title type='text'>Exam 70-568 and 70-569 prep links</title><content type='html'>&lt;p&gt;Update- I've now created a &lt;a href="http://richardod.blogspot.com/2009/05/microsoft-70-568-exam-study-guide.html"&gt;"study guide for 70-568".&lt;/a&gt; &lt;/p&gt;&lt;p&gt;I’ve been waiting for these two upgrade exams to become available for what seems like an eternity. Links are now available for the exams on the Microsoft Website (though they don’t yet appear to be indexed by Google).&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/learning/en/us/Exams/70-568.aspx" target="_blank"&gt;Exam 70-568 official prep guide&lt;/a&gt; &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.microsoft.com/learning/en/us/Exams/70-569.aspx" target="_blank"&gt;Exam 70-569 official prep guide&lt;/a&gt; &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I hope to add any links to useful Websites I discover whilst studying for these upgrade exams.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-8164017386356827935?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/8164017386356827935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/03/exam-70-568-and-70-569-prep-links.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/8164017386356827935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/8164017386356827935'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/03/exam-70-568-and-70-569-prep-links.html' title='Exam 70-568 and 70-569 prep links'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-5387244422069491619</id><published>2009-03-14T11:22:00.000Z</published><updated>2009-03-24T21:25:00.317Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2008'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Designer Time bug'/><title type='text'>Visual Studio 2008 ASP.NET designer bug</title><content type='html'>Update: This has now been fixed. &lt;a href="http://richardod.blogspot.com/2009/03/visual-studio-gridview-designer-fix.html"&gt;Please see my new post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The ASP.NET designer in Visual Studio 2008 has a bug where the aspx code might not get updated when making changes in the design view- this only happens under certain conditions. Currently (14th March 2009), there is &lt;a href="http://forums.asp.net/t/1380268.aspx"&gt;no fix for this known issue&lt;/a&gt;. When a fix is made available it will be posted to the &lt;a href="http://blogs.msdn.com/webdevtools/"&gt;Visual Web Developer Team Blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In the meantime as a workaround, I am performing any designer required work on a new page in the project, and copying the generated aspx code manually.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-5387244422069491619?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/5387244422069491619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/03/visual-studio-2008-aspnet-designer-bug.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/5387244422069491619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/5387244422069491619'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/03/visual-studio-2008-aspnet-designer-bug.html' title='Visual Studio 2008 ASP.NET designer bug'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-724685353170639218.post-1291826933624920116</id><published>2009-03-01T15:51:00.000Z</published><updated>2009-03-08T15:17:18.391Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='ADO.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='performance tuning'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Speeding up SQL Server Inserts by using transactions</title><content type='html'>When ADO.NET 2.0 was released, one of the new features being touted was the ability for SqlDataAdapter to submit updates/inserts in batches. Having spent time recently optimizing an Oracle batch solution, I decided to investigate the batch functionality provided by the &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldataadapter.aspx"&gt;SqlDataAdapter&lt;/a&gt; (The SQL Server specific DataAdapter).&lt;br /&gt;&lt;br /&gt;Firing up &lt;a href="http://www.red-gate.com/products/reflector/"&gt;Reflector&lt;/a&gt; I discovered this functionality is encapsulated in the internal class SqlCommandSet, which resides in the System.Data DLL. If you are not using the SqlDataAdapter/Datasets in your project then you are out of luck (or so I thought).&lt;br /&gt;&lt;br /&gt;A quick Google for "SqlCommandSet" allowed me to find two posts by Oren Eini, who had exposed the functionality of this internal class via delegates (see &lt;a href="http://ayende.com/Blog/2006/09/13/OpeningUpQueryBatching.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://ayende.com/Blog/archive/2006/09/14/ThereBeDragonsRhinoCommonsSqlCommandSet.aspx"&gt;here&lt;/a&gt;). I hadn't considered leveraging the functionality of internal types using delegates before (I have done similar things using reflection, but not delegates).&lt;br /&gt;&lt;br /&gt;It turns out Oren's code has been included in &lt;a href="https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk/"&gt;Rhino Commons&lt;/a&gt;, in a wrapper class called &lt;a href="https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk/commons/Rhino.Commons/ToPublic/SqlCommandSet.cs"&gt;SqlCommandSet&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Oren fails to mention the performance increase gained by using transactions in a batch solution. This post discusses the increases that can be gained by using a transaction across the whole insert operation.&lt;br /&gt;&lt;br /&gt;Not wanting to have a dependency on Rhino Commons (I am sure it an excellent framework), and wanting to leverage the inbuilt-generic delegates of Func&lt;&gt; and Action&lt;&gt; (&lt;a href="http://blogs.msdn.com/brada/archive/2009/01/26/framework-design-guidelines-avoiding-custom-delegates.aspx"&gt;this is now best practise&lt;/a&gt;). I decided to write my own version:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;#region&lt;/span&gt; license&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Modified by Richard OD to exploit .NET 3.5 08 March 2009&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Copyright (c) 2005 - 2007 Ayende Rahien (ayende@ayende.com)&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// All rights reserved.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Redistribution and use in source and binary forms, with or without modification,&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// are permitted provided that the following conditions are met:&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Redistributions of source code must retain the above copyright notice,&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this list of conditions and the following disclaimer.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Redistributions in binary form must reproduce the above copyright notice,&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this list of conditions and the following disclaimer in the documentation&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and/or other materials provided with the distribution.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Neither the name of Ayende Rahien nor the names of its&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contributors may be used to endorse or promote products derived from this&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; software without specific prior written permission.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &amp;quot;AS IS&amp;quot; AND&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;#endregion&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Data.SqlClient;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Reflection;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; BatchUpdater&lt;/p&gt;&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;sealed&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlCommandSetWrapper&lt;/span&gt; : &lt;span style="color: #2b91af;"&gt;IDisposable&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Type&lt;/span&gt; commandSetType;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: blue;"&gt;object&lt;/span&gt; commandSet;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt;&amp;gt; appenderDel;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt; disposeDel;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;gt; executeNonQueryDel;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;&amp;gt; connectionGetDel;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;&amp;gt; connectionSetDel;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;readonly&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlTransaction&lt;/span&gt;&amp;gt; transactionSetDel;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; commandCount;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; SqlCommandSetWrapper()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Assembly&lt;/span&gt; systemData = &lt;span style="color: #2b91af;"&gt;Assembly&lt;/span&gt;.Load(&lt;span style="color: #a31515;"&gt;&amp;quot;System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; commandSetType = systemData.GetType(&lt;span style="color: #a31515;"&gt;&amp;quot;System.Data.SqlClient.SqlCommandSet&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; SqlCommandSetWrapper()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; commandSet = &lt;span style="color: #2b91af;"&gt;Activator&lt;/span&gt;.CreateInstance(commandSetType, &lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; appenderDel = (&lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt;&amp;gt;)&lt;span style="color: #2b91af;"&gt;Delegate&lt;/span&gt;.CreateDelegate(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt;&amp;gt;), commandSet, &lt;span style="color: #a31515;"&gt;&amp;quot;Append&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; disposeDel = (&lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;)&lt;span style="color: #2b91af;"&gt;Delegate&lt;/span&gt;.CreateDelegate(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;), commandSet, &lt;span style="color: #a31515;"&gt;&amp;quot;Dispose&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; executeNonQueryDel = (&lt;span style="color: #2b91af;"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;gt;)&lt;span style="color: #2b91af;"&gt;Delegate&lt;/span&gt;.CreateDelegate(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;int&lt;/span&gt;&amp;gt;), commandSet, &lt;span style="color: #a31515;"&gt;&amp;quot;ExecuteNonQuery&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; connectionGetDel = (&lt;span style="color: #2b91af;"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;&amp;gt;)&lt;span style="color: #2b91af;"&gt;Delegate&lt;/span&gt;.CreateDelegate(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;&amp;gt;), commandSet, &lt;span style="color: #a31515;"&gt;&amp;quot;get_Connection&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; connectionSetDel = (&lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;&amp;gt;)&lt;span style="color: #2b91af;"&gt;Delegate&lt;/span&gt;.CreateDelegate(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;&amp;gt;), commandSet, &lt;span style="color: #a31515;"&gt;&amp;quot;set_Connection&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; transactionSetDel = (&lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlTransaction&lt;/span&gt;&amp;gt;)&lt;span style="color: #2b91af;"&gt;Delegate&lt;/span&gt;.CreateDelegate(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;Action&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;SqlTransaction&lt;/span&gt;&amp;gt;), commandSet, &lt;span style="color: #a31515;"&gt;&amp;quot;set_Transaction&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Append(&lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt; command)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; commandCount++;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; appenderDel.Invoke(command);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; ExecuteNonQuery()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; executeNonQueryDel.Invoke();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt; Connection&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; connectionGetDel.Invoke();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; connectionSetDel.Invoke(&lt;span style="color: blue;"&gt;value&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlTransaction&lt;/span&gt; Transaction&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; transactionSetDel.Invoke(&lt;span style="color: blue;"&gt;value&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; CommandCount&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; commandCount;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Dispose()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; disposeDel.Invoke();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Of course this class is by its very nature risky- you should only use it in your own solutions after performing adequate testing. Also note that any changes to future versions of the .NET framework could make this class fail at runtime.&lt;br /&gt;&lt;br /&gt;I wanted to see the performance difference between batching SQL statements (via the SqlCommandSet class) and executing multiple commands. I also wanted to see what difference using transactions would make, and also the performance impact of using &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx"&gt;SQLBulkCopy&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I then wrote a test program to compare non batched inserts against SqlCommandSet and the SqlBulkCopy class.&lt;br /&gt;&lt;br /&gt;Here are the results (note in my case the DB is on the same machine as the C# app- not the usual separate DB server):&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_S3YrXat7Lwo/Saq7DPIyaFI/AAAAAAAAAAU/l4FNYNJ5KRY/s1600-h/adodotnetPerformance.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5308260775086942290" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 400px; CURSOR: pointer; HEIGHT: 201px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_S3YrXat7Lwo/Saq7DPIyaFI/AAAAAAAAAAU/l4FNYNJ5KRY/s400/adodotnetPerformance.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;By far the fastest was the &lt;a href="http://msdn.microsoft.com/en-us/library/7ek5da1a.aspx"&gt;SqlBulkCopy&lt;/a&gt;. This is unsurprising as this class is very similar to SQL Server's BCP program allowing it to bypass normal integrity checks and perform &lt;a href="http://msdn.microsoft.com/en-us/library/ms191244.aspx"&gt;minimal logging&lt;/a&gt;. The next fastest technique is using the SqlCommandSet with a transaction open throughout the operation, followed by a transaction open throughout the operation using seperate SqlCommand objects.&lt;br /&gt;&lt;br /&gt;The reason why the batched updates increases performance is due to every interaction with SQL Server requiring two-way communication with the database (handshaking). However sending too many statements in one batch can also hinder performance. In &lt;a href="http://www.amazon.co.uk/gp/product/073562206X?ie=UTF8&amp;amp;tag=myblo02-21&amp;amp;linkCode=as2&amp;amp;camp=1634&amp;amp;creative=6738&amp;amp;creativeASIN=073562206X"&gt;Programming Microsoft® ADO.NET 2.0 Core Reference&lt;/a&gt;&lt;img style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; MARGIN: 0px; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none" height="1" alt="" src="http://www.assoc-amazon.co.uk/e/ir?t=myblo02-21&amp;amp;l=as2&amp;amp;o=2&amp;amp;a=073562206X" width="1" border="0" /&gt; David Sceppa recommends using a batch size of between 100 and 1000 for optimum performance.&lt;br /&gt;&lt;br /&gt;Whilst it can be important to batch multiple updates to SQL Server, it is more important for performance to wrap them in a transaction. By default without specifying an explicit transaction, SQL Server will execute each statement in a separate transaction, regardless of whether or not the query is sent as a batch or each statement. Each transaction requires the log to be written to disk- writing this out in one go is going to be a lot more efficient than doing it for each individual statement.&lt;br /&gt;&lt;br /&gt;Here is the client test code (it could do with a bit of a cleanup):&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Configuration;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Data;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Data.SqlClient;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Diagnostics;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; BatchUpdater&lt;/p&gt;&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Program&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; connectionString = &lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;/span&gt;.ConnectionStrings[&lt;span style="color: #a31515;"&gt;&amp;quot;sqlServerDB&amp;quot;&lt;/span&gt;].ConnectionString;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; INSERT_STATEMENT = &lt;span style="color: #a31515;"&gt;&amp;quot;INSERT INTO SomeTable(SomeColumn) VALUES ('This is nice')&amp;quot;&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Truncate just to be sure&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TruncateTable();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Stopwatch&lt;/span&gt; sw = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Stopwatch&lt;/span&gt;();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt; batchSize = 1000;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Start();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PerformInsertsWithCommandSetWrapper(batchSize, &lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Stop();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;&amp;quot;Time with command set wrapper and transactions {0}&amp;quot;&lt;/span&gt;, sw.Elapsed);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Reset();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TruncateTable();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Start();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PerformInsertsUsingSingleCommands(&lt;span style="color: blue;"&gt;true&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Stop();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;&amp;quot;Time with single commands and transactions {0}&amp;quot;&lt;/span&gt;, sw.Elapsed);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Reset();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TruncateTable();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Start();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PerformInsertsWithCommandSetWrapper(batchSize, &lt;span style="color: blue;"&gt;false&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Stop();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;&amp;quot;Time with command set wrapper without transactions {0}&amp;quot;&lt;/span&gt;, sw.Elapsed);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Reset();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TruncateTable();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Start();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; PerformInsertsUsingSingleCommands(&lt;span style="color: blue;"&gt;false&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Stop();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;&amp;quot;Time with single commands without transactions {0}&amp;quot;&lt;/span&gt;, sw.Elapsed);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Reset();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TruncateTable();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;DataTable&lt;/span&gt; testData = GetTestData();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Start();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; UseBcp(testData);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sw.Stop();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515;"&gt;&amp;quot;Time with BCP {0}&amp;quot;&lt;/span&gt;, sw.Elapsed);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.ReadLine();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; PerformInsertsUsingSingleCommands(&lt;span style="color: blue;"&gt;bool&lt;/span&gt; useTransactions)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt; con = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;(connectionString))&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; con.Open();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlTransaction&lt;/span&gt; tran = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt;(useTransactions) tran = con.BeginTransaction();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 50000; i++)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt; cmd2 = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt;(INSERT_STATEMENT, con);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt;(useTransactions) cmd2.Transaction = tran;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cmd2.ExecuteNonQuery();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (useTransactions)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; tran.Commit();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; tran.Dispose();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; PerformInsertsWithCommandSetWrapper(&lt;span style="color: blue;"&gt;int&lt;/span&gt; batchSize, &lt;span style="color: blue;"&gt;bool&lt;/span&gt; useTransactions)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 50000; i = i + batchSize)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt; con = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;(connectionString))&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;SqlCommandSetWrapper&lt;/span&gt; wrapper = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlCommandSetWrapper&lt;/span&gt;())&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; j = 0; j &amp;lt; batchSize; j++)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt; cmd = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt;(INSERT_STATEMENT);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; wrapper.Append(cmd);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; wrapper.Connection = con;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; con.Open();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlTransaction&lt;/span&gt; tran = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt;(useTransactions)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; tran = con.BeginTransaction();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; wrapper.Transaction = tran;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; wrapper.ExecuteNonQuery();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (useTransactions)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; tran.Commit();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; tran.Dispose();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; TruncateTable()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt; cona = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlConnection&lt;/span&gt;(connectionString))&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cona.Open();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt; cmd = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;&amp;quot;TRUNCATE TABLE SomeTable&amp;quot;&lt;/span&gt;, cona);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cmd.ExecuteNonQuery();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DataTable&lt;/span&gt; GetTestData()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;DataTable&lt;/span&gt; dt = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DataTable&lt;/span&gt;();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dt.BeginLoadData();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Columns.Add(&lt;span style="color: #a31515;"&gt;&amp;quot;SomeColumn&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 50000; i++)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dt.Rows.Add(&lt;span style="color: #a31515;"&gt;&amp;quot;This is nice&amp;quot;&lt;/span&gt;);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; dt.EndLoadData();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; dt;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; UseBcp(&lt;span style="color: #2b91af;"&gt;DataTable&lt;/span&gt; dt)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlBulkCopy&lt;/span&gt; bcp = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlBulkCopy&lt;/span&gt;(connectionString);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; bcp.DestinationTableName = &lt;span style="color: #a31515;"&gt;&amp;quot;dbo.SomeTable&amp;quot;&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; bcp.WriteToServer(dt);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Of course it would be interesting to look at solutions when using &lt;a href="http://msdn.microsoft.com/en-us/library/bb425822.aspx"&gt;LINQ to SQL&lt;/a&gt; or &lt;a href="http://msdn.microsoft.com/en-us/library/bb386964.aspx"&gt;LINQ to Entities&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/724685353170639218-1291826933624920116?l=richardod.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://richardod.blogspot.com/feeds/1291826933624920116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://richardod.blogspot.com/2009/03/speeding-up-sql-server-inserts-by-using.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/1291826933624920116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/724685353170639218/posts/default/1291826933624920116'/><link rel='alternate' type='text/html' href='http://richardod.blogspot.com/2009/03/speeding-up-sql-server-inserts-by-using.html' title='Speeding up SQL Server Inserts by using transactions'/><author><name>Richard OD</name><uri>http://www.blogger.com/profile/13855706515612188950</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_S3YrXat7Lwo/Saq7DPIyaFI/AAAAAAAAAAU/l4FNYNJ5KRY/s72-c/adodotnetPerformance.gif' height='72' width='72'/><thr:total>2</thr:total></entry></feed>
