<?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-3606597030942128101</id><updated>2011-11-28T00:13:57.371+01:00</updated><category term='mobile'/><category term='reflection'/><category term='Wake On LAN'/><category term='SQL'/><category term='string parameter'/><category term='session_end'/><category term='asmx'/><category term='Garbage collector'/><category term='unmanaged resources'/><category term='event'/><category term='collection'/><category term='interfaces'/><category term='user.config properties.settings user settings'/><category term='threading'/><category term='bad request'/><category term='e-mail notification'/><category term='xml parameter'/><category term='find'/><category term='job'/><category term='IDisposable'/><category term='Dispose'/><category term='wildcards'/><category term='resources'/><category term='web service'/><category term='overloading'/><category term='performance'/><category term='Team foundation Server'/><category term='AddRange'/><category term='windowsupdate'/><category term='exchange'/><category term='Magic Packet'/><category term='automatic updates'/><category term='BACKUP'/><category term='xml'/><category term='hibernate'/><category term='linq'/><category term='enum'/><category term='visual studio 2008'/><category term='stored procedures'/><category term='web publish'/><category term='sql server maintenance task'/><category term='TFS'/><category term='deployment'/><category term='ROW_NUMBER()'/><category term='w715'/><category term='MSBuild'/><category term='delegates'/><category term='activesync'/><category term='WOL'/><category term='eventhandler'/><category term='replace'/><category term='C#'/><category term='regex'/><category term='alert'/><category term='minify'/><category term='Function wizard'/><category term='collector collection'/><category term='generics'/><category term='session'/><category term='asp.net'/><category term='Complex return type'/><category term='web deploy'/><category term='vista'/><category term='Entity Framework'/><title type='text'>Software Scenario</title><subtitle type='html'>Blogs from Software Scenario, a Microsoft Certified Gold Partner company, located in Oslo, Norway.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>26</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-6733978104409230649</id><published>2011-09-16T11:03:00.000+02:00</published><updated>2011-09-16T11:03:54.115+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='minify'/><category scheme='http://www.blogger.com/atom/ns#' term='deployment'/><category scheme='http://www.blogger.com/atom/ns#' term='Team foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='web deploy'/><category scheme='http://www.blogger.com/atom/ns#' term='TFS'/><category scheme='http://www.blogger.com/atom/ns#' term='MSBuild'/><category scheme='http://www.blogger.com/atom/ns#' term='web publish'/><title type='text'>Automatic web deployment from TFS build</title><content type='html'>We have recently started using Team Foundation Server 2010, and having a CI build running for every check-in was one of the things we were really enjoying. Then I saw Scott Hanselman's talk on web deployment - &lt;a href="http://www.hanselman.com/blog/WebDeploymentMadeAwesomeIfYoureUsingXCopyYoureDoingItWrong.aspx" target="_blank"&gt;if you're using Xcopy, you're doing it wrong!&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Of course, once I saw that , I &amp;nbsp;wanted an automated deployment to the development environment every night or so. To get that going, I had to do some research.&lt;br /&gt;&lt;br /&gt;Just so you know, the project I'm talking about consists of &amp;nbsp;three web applications, one DAL and two presentation layers. Of course all three need different configurations for the different environments (dev, test and production).&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-family: inherit; font-size: large;"&gt;Web.config transformations&lt;/span&gt;&lt;br /&gt;And as it turns out, there is a neat function in visual studio 2010 called "web.config transformations" for exactly this purpose. You can read about it&amp;nbsp;&lt;a href="http://weblogs.asp.net/srkirkland/archive/2009/10/13/common-web-config-transformations-with-visual-studio-2010.aspx" target="_blank"&gt;here at Scott's blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The most obvious example for using web.config transformations is probably database connectionstrings, but you &amp;nbsp;can replace most things&amp;nbsp;using this simple syntax:&lt;br /&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;&lt;b&gt;setting &lt;/b&gt;name="Your_Setting_name" serializeAs="String" xdt:Transform="Replace" xdt:Locator="Match(name)"&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;value&lt;/b&gt;&amp;gt;Your value here!&amp;lt;/&lt;b&gt;value&lt;/b&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;setting&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;The web.config translates directly to the build configuration. So if you're building in "Debug" you're going to use the web.Debug.config file for transformations. &amp;nbsp;In our setup, this is the CI build. For the nightly automated deploy, we're going to need a separate target, so we created one called &amp;nbsp;Dev-Snapshot, (perhaps it would have been even more apt with Nighly-Dev - but let's ute Dev-Snapshot for the remainder of this post).&lt;br /&gt;&lt;br /&gt;Then you need a build defintion on the TFS that uses the new build configuration. For instance, call it Dev-Snapshot like the build configuration, under Process and "Items to build", select the correct project and your newly defined build configuration. Now whenever you build using the Dev-Snapshot in Visual Studio, the original web.config will be used. Transformations are only applied when you publish - it will automagically transform the web.config using the web.Dev-Snapshot.config into the final web.config inside the deployment package.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-size: large;"&gt;Publish settings&lt;/span&gt;&lt;br /&gt;Now we have a working build of the development environment, tailored for deployment on our development server. &amp;nbsp;So how do we do the automatic deployment? Maybe there's a switch in TFS Build for it? No such luck.&lt;br /&gt;&lt;br /&gt;The first thing you need to look at is your web project's publish settings. They too relate to the build configuration, so make sure you have selected the right one - again, for instance, Dev-Snapshot.&lt;br /&gt;&lt;br /&gt;Most interesting bits:&amp;nbsp;Under items to deploy, select "only files needed to run the application" - no .cs files, .csproj etc are not included in the package, just the "necessary files" (more on that later).&lt;br /&gt;&lt;br /&gt;You can choose to include database settings (out of scope for this post) and run any setup or change scripts directly. However, this probably fits best for any single-server solution, where you have one database server and one web server - in a web farm, you pretty much need to update all nodes whenever you change the db, though I suspect you might be able to run the db package only for the first node or something similar.&lt;br /&gt;&lt;br /&gt;Under Web Deployment Package settings you may choose to package as a zip file. I think this is useful. You need to specify where to create the package, and the name of the web site. This name must match the actual name of the web site you're planning to update on the server.&lt;br /&gt;&lt;br /&gt;After these settings are set, you may choose to test that they are actually working. Do this by rightclicking the project and select "Publish".&amp;nbsp;What the TFS will do later on is actually build a deployment package - which you can do by right-clicking the project and select "Build deployment package". Then go look in the destination you provided in the settings - you should have some files there.&lt;br /&gt;&lt;br /&gt;Read more about this in &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/07/29/vs-2010-web-deployment.aspx" target="_blank"&gt;Scott Gu's blog post&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-size: large;"&gt;Deploying from TFS&lt;/span&gt;&lt;br /&gt;Now that we have a working web.config transformation and web publish settings, the stage is set for the TFS Build server (and MSBuild in the background). In Team Explorer, go to Builds and right-click the one you're working with. Then go to the Process section, and under "Items to build" make sure you have the correct project with the correct configuration selected (in this example - Dev-Snapshot configuration).&lt;br /&gt;&lt;br /&gt;Open the "3. Advanced" section and go down to MSBuild arguments. Enter&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;/p:DeployOnBuild=True /p:IsAutoBuild=True&lt;/span&gt;&lt;/blockquote&gt;The first one tells MSBuild to build a deployment package after the build has completed, the second tells TFS that this is an automated build, as opposed to a manually triggered one.&lt;br /&gt;&lt;br /&gt;If you try queueing this build now, it should be working fine. You can open the build drop location to see the deployment package. But there's one step missing &amp;nbsp;- the deployment itself! /p:DeployOnBuild=True &amp;nbsp;as mentioned, only tells MSbuild to create the deployment package. It does not run the deployment script.&amp;nbsp;That's not really automatic deployment...&lt;br /&gt;&lt;br /&gt;So what I found out is that you can use a post-build event to call the script. The post-build event is found by right-clicking the project and selecting Properties, then Build events. Surprise, surprise, the Build Events are common to all configurations! which means, you can't simply run the script here, you have to run it according to the configuration. Or else, you could end up with any build ending up on your production server. Bad news.&lt;br /&gt;&lt;br /&gt;Enter a condition that will be true for your build - $(ConfigurationName) is a build variable that matches the Build configuration - and then create the command needed to execute the script:&lt;br /&gt;&lt;blockquote&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;if "$(ConfigurationName)" == "Dev-snapshot" "$(TargetDir)_PublishedWebsites\Projectname_Package\Projectname.deploy.cmd" /Y /u:publishuser /p:secret! /M:yourwebserver&lt;/span&gt;&lt;/blockquote&gt;Of course, your configuration will vary from this, but the basic idea should be clear, and while a little messy this can be extended to as many builds as you like, just keep on adding conditions.&lt;br /&gt;&lt;br /&gt;If you have some common settings for some builds - let's say your development and test environment has some common tasks - you can distinguish them with the IsAutoBuild parameter - $IsAutoBuild == 'True'.&lt;br /&gt;&lt;br /&gt;Now, if you queue up this build, you should actually have a ready published web site. Or a failed build. Make sure you have installed the web deployment package on the remote server, opened the correct port in the firewall and that the service is indeed running! &lt;a href="http://technet.microsoft.com/en-us/library/dd569059(WS.10).aspx"&gt;Details here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-size: large;"&gt;Missing files?&lt;/span&gt;&lt;br /&gt;Well the deployment is now working - new files are appearing on your web server when you build. But in my case there were at least some files that weren't appearing. Also there were some empty directories, that would be populated at runtime, suddenly missing. Strange.&lt;br /&gt;&lt;br /&gt;So you may remember that setting for "Only files needed to run the application". It determines by itself what is needed. Turns out, .class files, .pdf's, .zip and .csv files are "not needed". In addition, empty directories are not included in the deployment. It actually half makes sense, though there should be some way for the developer to specify the details.&lt;br /&gt;&lt;br /&gt;However, there is not in the GUI - but there is in the build process, if you use the build targets inside the project file! Sam Stephens has&lt;a href="http://blog.samstephens.co.nz/2010-10-18/msbuild-including-extra-files-multiple-builds/" target="_blank"&gt; a blog post on this.&lt;/a&gt;&amp;nbsp;You can either add this directly to your project file, or you can create a separate .target file for tidyness. A word of caution for the latter, while more tidy, it requires you to close and reopen the solution (!) for changes to be effective. Inside the project file you "only" need to unload and reload the project.&lt;br /&gt;&lt;br /&gt;Here's the target configuration for the missing files in my project (the \**\ just means all directories, recursively):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;&lt;b&gt;PropertyGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;CopyAllFilesToSingleFolderForPackageDependsOn&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; CustomCollectClassFiles;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; $(CopyAllFilesToSingleFolderForPackageDependsOn);&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;CopyAllFilesToSingleFolderForPackageDependsOn&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;lt;/&lt;b&gt;PropertyGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;&lt;b&gt;Target &lt;/b&gt;Name="CustomCollectClassFiles"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;ItemGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;_CustomClassFilesForRootFolder &lt;/b&gt;Include=".\**\*.class;.\**\*.zip;.\**\*.csv;.\**\*.pdf"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;DestinationRelativePath&lt;/b&gt;&amp;gt;%(RecursiveDir)%(Filename)%(Extension)&amp;lt;/DestinationRelativePath&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;_CustomClassFilesForRootFolder&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;FilesForPackagingFromProject &lt;/b&gt;Include="%(_CustomClassFilesForRootFolder.Identity)"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;DestinationRelativePath&amp;gt;.\%(RecursiveDir)%(Filename)%(Extension)&amp;lt;/DestinationRelativePath&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;FilesForPackagingFromProject&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;ItemGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;lt;/&lt;b&gt;Target&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;That covers the missing files, but the empty folders need another target. Or, you can simply add an empty file in the folder for it to be picked up, but that is really a hack.&lt;br /&gt;&lt;br /&gt;I found a better way of doing it through the AfterAddIisSettingAndFileContentsToSourceManifest - a target that is defined by the web deployment publishing pipeline. It's kind of hard to find a complete list of the targets involved, but feel free add one in the comments.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;&lt;b&gt;PropertyGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;AfterAddIisSettingAndFileContentsToSourceManifest&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; MakeEmptyFolders&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;AfterAddIisSettingAndFileContentsToSourceManifest&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;lt;/&lt;b&gt;PropertyGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;&lt;b&gt;Target &lt;/b&gt;Name="MakeEmptyFolders"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;Message &lt;/b&gt;Text="Adding empty folder to hold snapshots...$(_MSDeployDirPath_FullPath)\SnapshotImages" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;MakeDir &lt;/b&gt;Directories="$(_MSDeployDirPath_FullPath)\SnapshotImages"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;lt;/&lt;b&gt;Target&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There. Missing files and folders no more.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #0b5394; font-size: large;"&gt;Minifying javascript Build-Time&lt;/span&gt;&lt;br /&gt;Since this is a web application, I will add a final note about the minifying task. I used the Ajax Minify from Microsoft, but I'm sure the same applies to the other tools as well, just with a different command line. Before I started on the automatic deployment project, we were using the AfterBuild target for minify operations, which worked out well, when a batch script (using robocopy!) was doing the deployment.&lt;br /&gt;&lt;br /&gt;But when the deployment package is built, the AfterBuild target is not yet entered. So we switched to BeforeBuild to get around that - and it works perfectly. Unless you are emitting javascript files from your build, the same approach should be fine for you.&lt;br /&gt;&lt;br /&gt;Here's what happens: First, delete the old files. Then, concatenate any separate files into one big .js file. Then, minify that file. In addition, you obviously have to reference that minified .js from your master page or what ever other page you need it in.&amp;nbsp;I'd also suggest renaming the .js file for each version to avoid caching problems, but that's another story.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;&lt;b&gt;Target &lt;/b&gt;Name="BeforeBuild"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;&amp;lt;!-- we need to minify the .js files before build, because they must be included in the deployment package --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;Message &lt;/b&gt;Text="Going to delete old JS files..." /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;Delete &lt;/b&gt;Files=".\Controls\Javascript\Concatenated.js;.\Controls\Javascript\Concatenated.min.js" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;Message &lt;/b&gt;Text="Concatenating JavaScript files..." /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;ItemGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;InFiles &lt;/b&gt;Include=".\Controls\Javascript\*.js" /&amp;gt; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;InFiles &lt;/b&gt;Include=".\Controls\JsFolder\*.js" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;ItemGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;ReadLinesFromFile &lt;/b&gt;File="%(InFiles.Identity)"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;Output &lt;/b&gt;TaskParameter="Lines" ItemName="lines" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;ReadLinesFromFile&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;WriteLinesToFile &lt;/b&gt;File=".\Controls\Javascript\Concatenated.js" Lines="@(Lines)" Overwrite="true" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;Message &lt;/b&gt;Text="Minifying JavaScript files..." /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;ItemGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;JS Include=".\Controls\Javascript\Concatenated.js" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;b&gt;ItemGroup&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;&amp;lt;!-- Minify javascript files in .\Controls\Javascript --&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;b&gt;AjaxMin &lt;/b&gt;SourceFiles="@(JS)" SourceExtensionPattern="\.js$" TargetExtension=".min.js" CollapseToLiteral="True" LocalRenaming="CrunchAll" OutputMode="SingleLine" RemoveUnneededCode="True" StripDebugStatements="True" EvalsAreSafe="True" InlineSafeSettings="True" CombineDuplicateLiterals="True" CatchAsLocal="True" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;lt;/&lt;b&gt;Target&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-6733978104409230649?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/6733978104409230649/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=6733978104409230649' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/6733978104409230649'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/6733978104409230649'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2011/09/automatic-web-deployment-from-tfs-build.html' title='Automatic web deployment from TFS build'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-8461401894761412137</id><published>2011-08-01T15:37:00.007+02:00</published><updated>2011-08-01T16:46:58.485+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Wake On LAN'/><category scheme='http://www.blogger.com/atom/ns#' term='Magic Packet'/><category scheme='http://www.blogger.com/atom/ns#' term='WOL'/><title type='text'>Wake On Lan..not so easy.</title><content type='html'>&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;Hi, just a quick tutorial on how to make you pc wake up remotely &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;from sleep mode. One would think that this is just one click &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;operation, but no: &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;NB: Mind you this is a ASUS P5Q deluxe motherboard- sure &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;settings are different on other mb.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;1.&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt; BIOS: you need to enable wake on LAN or as in my case:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Power- &lt;/span&gt; APM configuration - Power on by PCI = Enabled&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;/span&gt;Advanced - Marvell LAN 2- LAN Boot Rom = Enabled&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;2.&lt;/b&gt; Win7 : &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;Control panel- Network and Sharing Center- Change adapter settings: &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;Right click on the "Local Area Connection" in use, then click configure.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;Choose the Advance tab: "Energy Star" =Disabled, &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;"&lt;/span&gt;Wake From Shutdown" &lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;= On,&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;Power Management tab: All of the checkboxes should be checked. &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span"&gt;&lt;a href="http://2.bp.blogspot.com/-ZyGrlbfnR6Y/TjavbcMozxI/AAAAAAAAAZI/sFIWdKGtsiM/s1600/powermanagement.JPG" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 286px; height: 320px;" src="http://2.bp.blogspot.com/-ZyGrlbfnR6Y/TjavbcMozxI/AAAAAAAAAZI/sFIWdKGtsiM/s320/powermanagement.JPG" border="0" alt="" id="BLOGGER_PHOTO_ID_5635884869661282066" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;3.&lt;/b&gt; Install a program which sends the magic packet. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;I use this one : &lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; "&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;&lt;a href="http://www.depicus.com/wake-on-lan/wake-on-lan-gui.aspx"&gt;http://www.depicus.com/wake-on-lan/wake-on-lan-gui.aspx&lt;/a&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; "&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt;&lt;span class="Apple-tab-span" style="font-size: medium; white-space: pre; "&gt; &lt;/span&gt;&lt;span class="Apple-style-span" &gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" &gt;simple, but does the job.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; "&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; "&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;PS: there is also an Android app for this at Android Market. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; "&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt; &lt;/span&gt;NB -When using the phone you have to establish a VPN &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; "&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;  &lt;/span&gt;connection before using the WOL application.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; "&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman', serif; "&gt;&lt;span lang="EN-US"&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;4.&lt;/b&gt; &lt;/span&gt;&lt;span class="Apple-style-span"&gt;Now you can use Remote desktop or something similar to connect to your pc.&lt;/span&gt;&lt;span class="Apple-style-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;i&gt;Ref this forumpost : &lt;a href="http://vip.asus.com/forum/view.aspx?id=20080721172544250&amp;amp;board_id=1&amp;amp;model=P5Q+Deluxe&amp;amp;SLanguage=en-us&amp;amp;page=1"&gt;http://vip.asus.com/forum/view.aspx?id=20080721172544250&amp;amp;board_id=1&amp;amp;model=P5Q+Deluxe&amp;amp;SLanguage=en-us&amp;amp;page=1&lt;/a&gt;&lt;/i&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-8461401894761412137?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/8461401894761412137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=8461401894761412137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/8461401894761412137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/8461401894761412137'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2011/08/wake-on-lannot-so-easy.html' title='Wake On Lan..not so easy.'/><author><name>Espen Rudrud</name><uri>http://www.blogger.com/profile/12460861783595994105</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://2.bp.blogspot.com/-ZyGrlbfnR6Y/TjavbcMozxI/AAAAAAAAAZI/sFIWdKGtsiM/s72-c/powermanagement.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-1188873892263365693</id><published>2011-06-03T13:19:00.009+02:00</published><updated>2011-06-06T14:04:33.482+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stored procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='Function wizard'/><category scheme='http://www.blogger.com/atom/ns#' term='Complex return type'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Entity Framework'/><title type='text'>Entiy Framework  Add Function Import - Get Column Information returns nothing..</title><content type='html'>&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;I needed to update a sql stored procedure in our entity data model.  In the Model Browser I clicked "Update Model from Database" and then double clicked on the SP under functions import to open the "Edit function import" wizard so I could make the complex return type from the SP.  To my surprice the import wizard told me that "The selected stored procedure returns no columns"? I knew for a fact that the SP returned several rows. &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; "&gt;After a little Google searching I found a solution in this forum post from "Brian”: &lt;a href="http://social.msdn.microsoft.com/Forums/en/adodotnetentityframework/thread/e7f598a2-6827-4b27-a09d-aefe733b48e6"&gt;Microsoft forum&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div&gt;&lt;div&gt;Quote: "&lt;/div&gt;&lt;div&gt;&lt;blockquote style="color: rgb(51, 51, 51); font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px; "&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;it seems Entity Framework will try to get the columns by executing your Stored Procedure, passing NULL for every argument. You can see this by putting a trace on your SQL Server.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;So - first make sure your S_P will return something under these circumstances. Note it may have been smarter for Entity Framework to execute the Stored Proc with Default Values for arguments, as opposed to NULLS. Never mind - nothing we can do about that!&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;However - before trying to run the Stored Procedure, ER does this&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;SET FMTONLY ON&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;This will break your stored procedure in various circumstances, in particular, if it uses a temp table.&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;So, add to the start of your Stored Procedure:&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;SET FMTONLY OFF;&lt;/p&gt;&lt;p style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; "&gt;This worked for me - hope it works for you too.&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; color: rgb(51, 51, 51); font-size: 13px; line-height: 16px; "&gt;&lt;/p&gt;&lt;p style="border-style: initial; border-color: initial; font-weight: inherit; font-style: inherit; font-family: inherit; margin-top: 1em; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; list-style-type: none; text-decoration: none; color: rgb(51, 51, 51); font-size: 13px; line-height: 16px; "&gt;brian&lt;/p&gt;&lt;/div&gt;&lt;div&gt;"&lt;/div&gt;&lt;div&gt;One other work around or maybe a better solution is to not use temp tables at all, if you don’t need too index those tables that is.&lt;/div&gt;&lt;div&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;If you use &lt;b&gt;table variables&lt;/b&gt;, the SET FMTONLY ON; option will not break in your stored procedure. Performance wise, except indexing option on temp tables, they seem quite the same. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span lang="EN-US" style="mso-ansi-language:EN-US"&gt;Ref this article:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;a href="http://sqlnerd.blogspot.com/2005/09/temp-tables-vs-table-variables.html"&gt;SQL Rocks &lt;span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: 'Trebuchet MS', Verdana, Arial, sans-serif; font-size: 17px; line-height: 25px; "&gt;Temp Tables vs Table Variables&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-1188873892263365693?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/1188873892263365693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=1188873892263365693' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/1188873892263365693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/1188873892263365693'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2011/06/entiy-framework-add-function-import-get.html' title='Entiy Framework  Add Function Import - Get Column Information returns nothing..'/><author><name>Espen Rudrud</name><uri>http://www.blogger.com/profile/12460861783595994105</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-3606597030942128101.post-8980684103924908058</id><published>2010-12-22T13:09:00.004+01:00</published><updated>2010-12-22T13:13:26.266+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='resources'/><category scheme='http://www.blogger.com/atom/ns#' term='regex'/><title type='text'>Cheat Sheets from AddedBytes</title><content type='html'>I don't work with regex every day, the same applies to many developers I guess.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So I was very happy when I found the excellent regex cheat sheets from IloveJackDaniels.com. But here one day it turned out that page was gone - so to save anyone else the trouble, they have moved to addedbytes.com.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And here's a link to their cheat sheets:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.addedbytes.com/cheat-sheets/"&gt;http://www.addedbytes.com/cheat-sheets/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You'll find two versions of Regular Expression cheat sheets, along with CSS, Python, Javascript and more.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-8980684103924908058?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/8980684103924908058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=8980684103924908058' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/8980684103924908058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/8980684103924908058'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2010/12/cheat-sheets-from-addedbytes.html' title='Cheat Sheets from AddedBytes'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-3056913467980999706</id><published>2010-10-12T10:19:00.004+02:00</published><updated>2010-10-12T10:23:30.830+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='overloading'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='web service'/><title type='text'>ASP.NET Web service gotcha</title><content type='html'>The last 30 minutes spent debugging why suddenly my .asmx didn't show the default web service front end any more. I could not invoke the service through the browser.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then I tried looking at the wsdl, which gave me a clue...&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Times New Roman'; font-size: medium; "&gt;&lt;pre style="word-wrap: break-word; white-space: pre-wrap; "&gt;System.InvalidOperationException: Both System.String InsertNewUserInCRM(MBL.UserData.CobraMontelUser) and System.String InsertNewUserInCRM(System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String, System.String) use the message name 'InsertNewUserInCRM'.  Use the MessageName property of the WebMethod custom attribute to specify unique message names for the methods.&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;So now you see what I saw: I tried overloading web methods, which of course won't work. But there was no build error, no warning in VS and no error on the web page!&lt;br /&gt;&lt;br /&gt;Fix: Either create a new name for the second method, or change the messagename, for example:&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;[WebMethod( MessageName ="InsertCobraMontelUser")]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-3056913467980999706?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/3056913467980999706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=3056913467980999706' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/3056913467980999706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/3056913467980999706'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2010/10/aspnet-web-service-gotcha.html' title='ASP.NET Web service gotcha'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-8443104666414834842</id><published>2010-07-08T12:20:00.007+02:00</published><updated>2010-07-08T13:27:33.101+02:00</updated><title type='text'>Culture Performace .NET 3.5 vs .Net 4.0</title><content type='html'>&lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;After converting an application from .net 3.5 to .net 4, I noticed the performance was really reduced at the application startup, where it loads and processes lots of Quote data.&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;The Performance Wizard clearly showed that the function doing the most work was System.DateTime.Parse(string). If  I changed the Target Framework for the application to 3.5, it was again back to normal behavior.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;I then made a test console application with a single loop trying to parse 2000 dates to an array. The elements was processed at the same time in both frameworks, so I was clearly missing something.&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;  &lt;/p&gt;&lt;table style="border-collapse: collapse; width: 165pt;" border="0" cellpadding="0" cellspacing="0" width="220"&gt;&lt;col style="width: 117pt;" width="156"&gt;  &lt;col style="width: 48pt;" width="64"&gt;  &lt;tbody&gt;&lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl69"    style="border: 0.5pt solid windowtext; background: rgb(141, 180, 227) none repeat scroll 0% 0%; height: 15pt; width: 117pt; font-weight: 700; text-decoration: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:windowtext;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;Framework&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl70"    style="border: 0.5pt solid windowtext; background: rgb(141, 180, 227) none repeat scroll 0% 0%; width: 48pt; font-weight: 700; text-decoration: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:windowtext;" width="64"&gt;&lt;span style="font-size:85%;"&gt; Ms&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl67"    style="border: 0.5pt solid windowtext; height: 15pt; width: 117pt; font-weight: 400; text-decoration: none; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:black;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;.NET 3.5&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl65"    style="border: 0.5pt solid windowtext; width: 48pt; font-weight: 400; text-decoration: none;font-family:Consolas;font-size:10.5pt;color:black;" width="64"&gt;&lt;span style="font-size:85%;"&gt; 4&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl68"    style="border: 0.5pt solid windowtext; height: 15pt; width: 117pt; font-weight: 400; text-decoration: none; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:black;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;.NET 4.0&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl66"    style="border: 0.5pt solid windowtext; width: 48pt; font-weight: 400; text-decoration: none;font-family:Consolas;font-size:10.5pt;color:black;" width="64"&gt;&lt;span style="font-size:85%;"&gt; 3&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span style="font-size:85%;"&gt;I then noticed the only difference, was that I in the initial application changed the current culture in the function that was processing the data, like this: System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("nb-NO"); After adding this culture change to the test app, the .NET 4 framework was using considerable more time than in .net3.5:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;table style="border-collapse: collapse; width: 165pt;" border="0" cellpadding="0" cellspacing="0" width="220"&gt;&lt;tbody&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td class="xl67"    style="border: 0.5pt solid windowtext; background: rgb(141, 180, 227) none repeat scroll 0% 0%; height: 15pt; width: 117pt; font-weight: 700; text-decoration: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous;font-family:Consolas;font-size:10.5pt;color:windowtext;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;Framework&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl68"    style="border: 0.5pt solid windowtext; background: rgb(141, 180, 227) none repeat scroll 0% 0%; width: 48pt; font-weight: 700; text-decoration: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:windowtext;" width="64"&gt;&lt;span style="font-size:85%;"&gt; Ms&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl65"    style="border: 0.5pt solid windowtext; height: 15pt; width: 117pt; font-weight: 400; text-decoration: none; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:black;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;.NET 3.5&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl69"    style="border: 0.5pt solid windowtext; width: 48pt; font-weight: 400; text-decoration: none;font-family:Consolas;font-size:10.5pt;color:black;" width="64"&gt;&lt;span style="font-size:85%;"&gt; 398&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl66"    style="border: 0.5pt solid windowtext; height: 15pt; width: 117pt; font-weight: 400; text-decoration: none; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:black;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;.NET 4.0&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl70"    style="border: 0.5pt solid windowtext; width: 48pt; font-weight: bold; text-decoration: none;font-family:Consolas;font-size:10.5pt;color:black;" width="64"&gt;&lt;span style="font-size:85%;"&gt; 2835&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span style=";font-size:85%;color:black;"   lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;What they changed from .NET 3.5 to .NET 4 did not have time to figure out, but I found an easy solution. Instead of changing the culture of the thread, I set the culture when parsing like this:&lt;br /&gt;.. = DateTime.Parse(feedarr[soucreIndex], CultureInfo.GetCultureInfo("nb-NO"));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span style="font-size:85%;"&gt;It then used 5 ms&lt;/span&gt;&lt;/p&gt;&lt;table style="border-collapse: collapse; width: 165pt;" border="0" cellpadding="0" cellspacing="0" width="220"&gt;&lt;tbody&gt;&lt;tr style="height: 15pt;" height="20"&gt;&lt;td class="xl67"    style="border: 0.5pt solid windowtext; background: rgb(141, 180, 227) none repeat scroll 0% 0%; height: 15pt; width: 117pt; font-weight: 700; text-decoration: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:windowtext;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;Framework&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl70"    style="border: 0.5pt solid windowtext; background: rgb(141, 180, 227) none repeat scroll 0% 0%; width: 48pt; font-weight: 700; text-decoration: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:windowtext;" width="64"&gt;&lt;span style="font-size:85%;"&gt; Ms&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl65"    style="border: 0.5pt solid windowtext; height: 15pt; width: 117pt; font-weight: 400; text-decoration: none; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:black;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;.NET 3.5&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl68"    style="border: 0.5pt solid windowtext; width: 48pt; font-weight: 400; text-decoration: none;font-family:Consolas;font-size:10.5pt;color:black;" width="64"&gt;&lt;span style="font-size:85%;"&gt; 6&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl66"    style="border: 0.5pt solid windowtext; height: 15pt; width: 117pt; font-weight: 400; text-decoration: none; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:black;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;.NET 4.0&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl69"    style="border: 0.5pt solid windowtext; width: 48pt; font-weight: 400; text-decoration: none;font-family:Consolas;font-size:10.5pt;color:black;" width="64"&gt;&lt;span style="font-size:85%;"&gt; 5&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;I then took it further in using parseexact: DateTime dd = DateTime.ParseExact(feedarr[1], "dd.MM.yyyy HH:mm:ss", CultureInfo.GetCultureInfo("nb-NO"));&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;It then took 3 ms in .NET 4.0.&lt;br /&gt;&lt;/span&gt;  &lt;/p&gt;&lt;table style="border-collapse: collapse; width: 165pt;" border="0" cellpadding="0" cellspacing="0" width="220"&gt;&lt;col style="width: 117pt;" width="156"&gt;  &lt;col style="width: 48pt;" width="64"&gt;  &lt;tbody&gt;&lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl67"    style="border: 0.5pt solid windowtext; background: rgb(141, 180, 227) none repeat scroll 0% 0%; height: 15pt; width: 117pt; font-weight: 700; text-decoration: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:windowtext;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;Framework&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl70"    style="border: 0.5pt solid windowtext; background: rgb(141, 180, 227) none repeat scroll 0% 0%; width: 48pt; font-weight: 700; text-decoration: none; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:windowtext;" width="64"&gt;&lt;span style="font-size:85%;"&gt; Ms&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl65"    style="border: 0.5pt solid windowtext; height: 15pt; width: 117pt; font-weight: 400; text-decoration: none; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:black;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;.NET 3.5&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl68"    style="border: 0.5pt solid windowtext; width: 48pt; font-weight: 400; text-decoration: none;font-family:Consolas;font-size:10.5pt;color:black;" width="64"&gt;&lt;span style="font-size:85%;"&gt; 6&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;  &lt;tr style="height: 15pt;" height="20"&gt;   &lt;td class="xl66"    style="border: 0.5pt solid windowtext; height: 15pt; width: 117pt; font-weight: 400; text-decoration: none; padding-bottom: 0cm; padding-top: 0cm;font-family:Consolas;font-size:10.5pt;color:black;" height="20" width="156"&gt;&lt;span style="font-size:85%;"&gt;.NET 4.0&lt;/span&gt;&lt;/td&gt;   &lt;td class="xl69"    style="border: 0.5pt solid windowtext; width: 48pt; font-weight: 400; text-decoration: none;font-family:Consolas;font-size:10.5pt;color:black;" width="64"&gt;&lt;span style="font-size:85%;"&gt; 3&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;p class="MsoPlainText"  style="font-family:georgia;"&gt;&lt;span  lang="EN-US" style="font-size:85%;"&gt;In a perfect world we would be no regional settings, but until further we are stuck with parsing the date format. As this post shows it’s important to do it the right way …  3 ms is a lot faster than 2 seconds 2835 milliseconds&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_WJoEzZ8tCiY/TDWon5WLcEI/AAAAAAAAAAU/crE4wzecocw/s1600/cluturePic.PNG"&gt;&lt;img style="cursor: pointer; width: 400px; height: 246px;" src="http://2.bp.blogspot.com/_WJoEzZ8tCiY/TDWon5WLcEI/AAAAAAAAAAU/crE4wzecocw/s400/cluturePic.PNG" alt="" id="BLOGGER_PHOTO_ID_5491480724010397762" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Happy programming&lt;br /&gt;Petter Søreide&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-8443104666414834842?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/8443104666414834842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=8443104666414834842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/8443104666414834842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/8443104666414834842'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2010/07/culture-performace-net-35-vs-net-40.html' title='Culture Performace .NET 3.5 vs .Net 4.0'/><author><name>Petter Søreide</name><uri>http://www.blogger.com/profile/08679516975056044805</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://2.bp.blogspot.com/_WJoEzZ8tCiY/TDWon5WLcEI/AAAAAAAAAAU/crE4wzecocw/s72-c/cluturePic.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-1060950116783530265</id><published>2009-12-13T16:27:00.003+01:00</published><updated>2009-12-13T16:34:53.641+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server maintenance task'/><category scheme='http://www.blogger.com/atom/ns#' term='e-mail notification'/><category scheme='http://www.blogger.com/atom/ns#' term='job'/><category scheme='http://www.blogger.com/atom/ns#' term='alert'/><title type='text'>E-mail reporting from Maintenance tasks in SQL Server 2008</title><content type='html'>Just migrated two databases to a new 2008 server, when I discovered something weird: You cannot choose in any way to alert operators on error in the maintenance plan. Under reports settings, there is a checkbox, but it's disabled, and I found that other users are not able to check it either. Plus it only allows you to send a report every time. Which is not what I want...&lt;br /&gt;&lt;br /&gt;The only workaround I found applies to scheduled tasks, which I guess is reasonable - if you run the job manually, you shouldn't need an  e-mail to see if it failed. SQL Server creates a job for you, that runs the task, and for jobs, you can set the Notification properties to send an e-mail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-1060950116783530265?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/1060950116783530265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=1060950116783530265' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/1060950116783530265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/1060950116783530265'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2009/12/e-mail-reporting-from-maintenance-tasks.html' title='E-mail reporting from Maintenance tasks in SQL Server 2008'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-5120165637586517411</id><published>2009-12-09T12:38:00.005+01:00</published><updated>2009-12-09T12:49:45.887+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asmx'/><category scheme='http://www.blogger.com/atom/ns#' term='xml parameter'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='web service'/><category scheme='http://www.blogger.com/atom/ns#' term='string parameter'/><category scheme='http://www.blogger.com/atom/ns#' term='bad request'/><title type='text'>Sending XML input to a web method expecting a string</title><content type='html'>I'm working on a project where I receive data in XML format. So far I have been using the auto-generated .asmx front-end form to send inn small XML one-liners just for testing my parsing logic.&lt;br /&gt;&lt;br /&gt;But when I wanted to use &lt;a href="http://www.soapui.org/"&gt;soap UI&lt;/a&gt; to send in larger portions, not to mention being able to save the whole scenario for later use, I ran into a problem. Whatever I sent in I only got "#status# HTTP/1.1 400 Bad Request".&lt;br /&gt;&lt;br /&gt;Even just sending just the XML declaration gave me this problem!&lt;br /&gt;&lt;br /&gt;But when I sent the exact same string from the auto-generated form, it was working perfectly. Which led me to believe there was (as usual) someone working behind the scenes, doing things without asking me.&lt;br /&gt;&lt;br /&gt;Finally I found   &lt;a href="http://stackoverflow.com/questions/1631785/soapui-request-returns-http-1-1-400-bad-request"&gt;a post with the answer I was looking for&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;In short, wrap your XML inside a &lt;a href="http://www.w3schools.com/xmL/xml_cdata.asp"&gt;CDATA  section&lt;/a&gt;, and you're good to go.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-5120165637586517411?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/5120165637586517411/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=5120165637586517411' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/5120165637586517411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/5120165637586517411'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2009/12/sending-xml-input-to-web-method.html' title='Sending XML input to a web method expecting a string'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-4808740901393578467</id><published>2009-06-11T21:19:00.002+02:00</published><updated>2009-06-11T21:30:37.678+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='enum'/><category scheme='http://www.blogger.com/atom/ns#' term='AddRange'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>How to get the values of an enum?</title><content type='html'>Sometimes you need to list the values of your enums. Typically, I have to represent them in dropdown-boxes for a web page. Here's my solution:&lt;br /&gt; &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;color:blue;"   &gt;public&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt; &lt;span style="color:blue;"&gt;static&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ListItem&lt;/span&gt;[] GetEnumValues(&lt;span style="color: rgb(43, 145, 175);"&gt;Type&lt;/span&gt; t)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&lt;&lt;span style="color: rgb(43, 145, 175);"&gt;ListItem&lt;/span&gt;&gt; lc = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&lt;&lt;span style="color: rgb(43, 145, 175);"&gt;ListItem&lt;/span&gt;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;lc.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ListItem&lt;/span&gt;() { Text = &lt;span style="color: rgb(163, 21, 21);"&gt;"Choose an item"&lt;/span&gt;, Value = &lt;span style="color: rgb(163, 21, 21);"&gt;"-1"&lt;/span&gt; });&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (t.UnderlyingSystemType.BaseType == &lt;span style="color:blue;"&gt;typeof&lt;/span&gt;(System.&lt;span style="color: rgb(43, 145, 175);"&gt;Enum&lt;/span&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color:blue;"&gt;int&lt;/span&gt; value &lt;span style="color:blue;"&gt;in&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Enum&lt;/span&gt;.GetValues(t))&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;                    &lt;/span&gt;lc.Add(&lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;ListItem&lt;/span&gt;() { Text = &lt;span style="color: rgb(43, 145, 175);"&gt;Enum&lt;/span&gt;.GetName(t, value), Value = value.ToString() });&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;     &lt;/span&gt;&lt;span style=""&gt;           &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;return&lt;/span&gt; lc.ToArray();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;Then, to use it in a control, use the Items.AddRange() function:&lt;br /&gt; &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;quot;Lucida Console&amp;quot;;"&gt;_dropdown.Items.AddRange(SomeClass.GetEnumValues(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(myEnumType&lt;span style="color: rgb(43, 145, 175);"&gt;&lt;/span&gt;)));&lt;/span&gt;&lt;/p&gt;Plain and easy, but as far as I know, not available directly from .NET.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-4808740901393578467?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/4808740901393578467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=4808740901393578467' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/4808740901393578467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/4808740901393578467'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2009/06/how-to-get-values-of-enum.html' title='How to get the values of an enum?'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-6773033044994202174</id><published>2009-06-08T11:57:00.006+02:00</published><updated>2009-06-09T12:03:59.909+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='find'/><category scheme='http://www.blogger.com/atom/ns#' term='wildcards'/><category scheme='http://www.blogger.com/atom/ns#' term='replace'/><category scheme='http://www.blogger.com/atom/ns#' term='visual studio 2008'/><title type='text'>Finding stuff in Visual Studio 2008</title><content type='html'>Usually when I try to find something in my code, instead of relying on my memory to help me locate it, I just press Ctrl+F on my keyboard, and let Visual Studio do the finding. If you didn't already know, you can also press Ctrl+H and go directly to the replace dialog (where you can search with wildcards, but you can't replace with them - &lt;span style="font-weight: bold;"&gt;that&lt;/span&gt; would have been a nice feature!).&lt;br /&gt;&lt;br /&gt;However, the find and replace dialog is a pretty powerful tool to locate stuff in your code, if you know how to use the options: Match case, match whole word, Search up, Search Hidden text, and Use. The first four are pretty straight-forward but if you don't know them or understand them from their names, here's a very quick update:&lt;br /&gt;Match case - if you write CONST, VS will not find const, Const or COnSt.&lt;br /&gt;Match whole word - if you write sum, VS will only find that, and not summary.&lt;br /&gt;Search up - default is down, but you can search up.&lt;span style="font-weight: bold; font-style: italic;"&gt; "Search up" feels buggy for me if you search in anything else than current document.&lt;/span&gt;&lt;br /&gt;Search hidden text - collapsed or otherwise hidden sections&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Wildcards&lt;/span&gt;&lt;br /&gt;If you check the "Use" checkbox, you can select an option from the dropdown, either Wildcards or Regular Expressions. Let's try the first one first, it is by far the easiest and for my part, most used. Wildcards are ?, * and #,  ? representing a single character,  # a single digit, and * being pretty much anything, like you would expect.&lt;br /&gt;&lt;br /&gt;If you want to find a single digit, you can search for  #, double digit is ##, and you get the picture. The same goes for ?, search for ?nt and get and, int, ent... I really don't use it that much. If you'd like to find all numbers in their forties, type 4# and there they are. Or use Int## if you would like to avoid other types of Int in your code. Might come in handy if you are looking for that special number...&lt;br /&gt;&lt;br /&gt;The * is my favorite. If I'm looking through a project to find a string that says "Sql-something", I'll just write Sql* and go. That's not very  much different from searching for Sql without checking "Match whole word" though, so try finding "*yste*" and see if you find System. Or combine with # and ? for interesting effects.&lt;br /&gt;&lt;br /&gt;You can even look for things like using( ... ), search for "using(*)" will help you. Tip: What if you want to find places you aren't using using? Search for example for *Connection(); or *Context();  - the semicolon will not be there if there is a using( ) wrapped around it.  Or even search for new *(); to find &lt;span style="font-weight: bold;"&gt;any&lt;/span&gt; instance of an object that's not inside a using block.&lt;br /&gt;&lt;br /&gt;And if you do want to search for # or * or ? in your code, and still use the wildcards, you can escape the characters using the backslash (\).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Regular expressions&lt;/span&gt;&lt;br /&gt;For the regular expressions, or regex as most developers call them, there is a very good cheat sheet available at  &lt;a href="http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/"&gt;addedbytes.com&lt;/a&gt; (previously ilovejackdaniels.com).  It's a very powerful feature, but thankfully I don't come across many situations where I need it.&lt;br /&gt;&lt;br /&gt;Microsoft has a reference to some &lt;a href="http://msdn.microsoft.com/en-us/library/2k3te2cs.aspx"&gt;short-hand expressions that VS understands&lt;/a&gt;,&lt;br /&gt;&lt;br /&gt;You could imagine having to find e-mail addresses referenced in an old app that you have inherited from another developer, who was fond of using @ in his code, perhaps in sql script written inline? You could go with regex and find only valid e-mail addresses. Or hex numbers, or all caps or all lowercase or enclosed in quotes, any kind of text that matches a given pattern.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-6773033044994202174?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/6773033044994202174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=6773033044994202174' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/6773033044994202174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/6773033044994202174'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2009/06/finding-stuff-in-visual-studio-2008.html' title='Finding stuff in Visual Studio 2008'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-7044140228115744724</id><published>2009-05-29T09:27:00.014+02:00</published><updated>2009-06-04T12:11:43.909+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='collection'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Performance testing of Dictionary, List and HashSet</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Update June 4, 2009&lt;/span&gt;&lt;br /&gt;The original post favored Dictionary as the fastest data structure both for add and contains. After some debate and some re-runs of my test code, I found the result to be wrong. HashSet is faster. Probably the results were  affected by the workload on my computer. I ran one List test, then a Dictionary test and finally a HashSet test - I should have run them multiple times and at the same workload (i.e. no programs or processes running). Anyway, on to the article.&lt;br /&gt;&lt;br /&gt;Still working with high-volume realtime datafeeds, I'm struggling to understand where the bottleneck in my code is. It's not with the database, it's not with the network - it's somewhere in the code. Now that doesn't help a lot.&lt;br /&gt;&lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;So I decided to have a look at the different data structures that could be usable for my needs. Right now I'm using a List to keep track of my orders, and each time I get a new order, I check that list for the given ID. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;So I'm starting to wonder, maybe there is a performance issue with the List data structure. So I made a small test with the following code:&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style=";font-size:85%;color:blue;"  &gt;static&lt;/span&gt;&lt;span style="font-size:85%;"&gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; TestList()&lt;br /&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; watch = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Stopwatch&lt;/span&gt;();&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; theList = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;List&lt;/span&gt;&lt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;      &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style=""&gt;//Fill it&lt;br /&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;int&lt;/span&gt; i = 0; i &lt;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;theList.Add(i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Stop();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Avg add time for List: {0}"&lt;/span&gt;, (watch.Elapsed.TotalMilliseconds / noOfIterations));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Reset();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;span style=""&gt;           &lt;/span&gt;&lt;span style="color:green;"&gt;//Test containsKey&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;int&lt;/span&gt; j = 0; j &lt;&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;                &lt;/span&gt;theList.Contains(j);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Stop();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"  style="margin-bottom: 0.0001pt; line-height: normal;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Avg Contains lookup time for List: {0}"&lt;/span&gt;, (watch.Elapsed.TotalMilliseconds / noOfIterations));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:10;"  &gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;I created similar test code for Dictionary&lt;int,int&gt; and HashSet&lt;int&gt;. In all of the tests I used a loop where the given key always existed in the data structure. I used Add instead of Insert, because of tests I've seen online show that this is much faster. For example, &lt;a href="http://dotnetperls.com/Content/List-Insert.aspx"&gt;this one.&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/int&gt;&lt;/int,int&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;First run, I used 1,000 for the noOfIterations variable and ran it three times.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IUO72aYh3tw/Sh-oG9_5f3I/AAAAAAAAAA0/OC-JtePQ18I/s1600-h/1K.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: left; cursor: pointer; width: 320px; height: 193px;" src="http://2.bp.blogspot.com/_IUO72aYh3tw/Sh-oG9_5f3I/AAAAAAAAAA0/OC-JtePQ18I/s320/1K.png" alt="" id="BLOGGER_PHOTO_ID_5341172520759951218" border="0" /&gt;&lt;/a&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;The horizontal scale here is in milliseconds, so things are reasonably fast. A value of 0.2 gives you a possible 200 adds &lt;i style=""&gt;per second&lt;/i&gt;. &lt;span style=""&gt; &lt;/span&gt;As you probably can see without checking the numbers, dictionary is faster. List is slower for lookup, but HashSet suprises a little with the slow add function. So what happens when we go to 100,000 items?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_IUO72aYh3tw/Sh-oHPqwmSI/AAAAAAAAAA8/GjpFUTQR9tE/s1600-h/100K-1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 193px;" src="http://2.bp.blogspot.com/_IUO72aYh3tw/Sh-oHPqwmSI/AAAAAAAAAA8/GjpFUTQR9tE/s320/100K-1.png" alt="" id="BLOGGER_PHOTO_ID_5341172525503125794" border="0" /&gt;&lt;/a&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;OK, List is a lot slower for lookup still. Add seems to compare ok though. Let's see how it compares if we remove the lookup-time from the chart: &lt;span style="color: rgb(255, 0, 0);"&gt;This is wrong, see "The aftermath"&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IUO72aYh3tw/Sh-oHXyFXbI/AAAAAAAAABE/pTNFjGb64zY/s1600-h/100k-2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 192px;" src="http://4.bp.blogspot.com/_IUO72aYh3tw/Sh-oHXyFXbI/AAAAAAAAABE/pTNFjGb64zY/s320/100k-2.png" alt="" id="BLOGGER_PHOTO_ID_5341172527681330610" border="0" /&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;Now that's a result! Turns out List is your winner if fast adding is all you care about. If you want to look up your values later though, dictionary is your winner. Hope this will save some time for other developers in the same situation. Also feel free to comment if you find different results, or a problem with my test!&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;By popular request: The rest of the code!&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;color:blue;"   &gt;static&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; TestDictionary()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; watch = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Stopwatch&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:green;"&gt;//Create Dictionary&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; theDict = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Dictionary&lt;/span&gt;&lt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;, &lt;span style="color:blue;"&gt;int&lt;/span&gt;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:green;"&gt;//Fill it&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&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;noofiterations;i++)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;theDict.Add(i, i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Stop();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Avg add time for Dictionary: {0}"&lt;/span&gt;, (watch.Elapsed.TotalMilliseconds/noOfIterations));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Reset();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:green;"&gt;//Test containsKey&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&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;noofiterations;j++)&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;theDict.ContainsKey(j);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Stop();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Avg Contains lookup time for Dictionary: {0}"&lt;/span&gt;,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;                              &lt;/span&gt;(watch.Elapsed.TotalMilliseconds/noOfIterations));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;color:blue;"   &gt;static&lt;/span&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt; &lt;span style="color:blue;"&gt;void&lt;/span&gt; TestHashSet()&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; watch = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;Stopwatch&lt;/span&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:green;"&gt;//Create List&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;var&lt;/span&gt; hashSet = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43, 145, 175);"&gt;HashSet&lt;/span&gt;&lt;&lt;span style="color:blue;"&gt;int&lt;/span&gt;&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:green;"&gt;//Fill it&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;color:green;"   &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;int&lt;/span&gt; i = 0; i &lt;&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;hashSet.Add(i);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Stop();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Avg add&lt;span style=""&gt;  &lt;/span&gt;time for HashSet: {0}"&lt;/span&gt;, (watch.Elapsed.TotalMilliseconds / noOfIterations));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Reset();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:green;"&gt;//Test contains&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color:blue;"&gt;for&lt;/span&gt; (&lt;span style="color:blue;"&gt;int&lt;/span&gt; j = 0; j &lt;&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;       &lt;/span&gt;&lt;span style=""&gt;     &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;                &lt;/span&gt;hashSet.Contains(j);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;watch.Stop();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal;"&gt;&lt;span style=";font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;            &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: rgb(163, 21, 21);"&gt;"Avg Contains lookup time for HashSet: {0}"&lt;/span&gt;, (watch.Elapsed.TotalMilliseconds / noOfIterations));&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style=""&gt;        &lt;/span&gt;}&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span style="line-height: 115%;font-family:&amp;quot;;font-size:85%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-family: georgia;"&gt;The aftermath&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: georgia;"&gt;Because of the controversy involved in HashSet being slower than Dictionary, despite having only one value and the Dictionary two, I re-ran the test on my computer, and on a colleagues. Instead of running the tests one by one, I ran three times HashTest and three times Dictionary, and picked the averages. The result you can see below, HashSet is faster than Dictionary both for Add and Contains methods.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;  &lt;p&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_IUO72aYh3tw/SiecCx0igII/AAAAAAAAABM/8btQIOaYXZA/s1600-h/hashSetvsDictionary.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 192px;" src="http://3.bp.blogspot.com/_IUO72aYh3tw/SiecCx0igII/AAAAAAAAABM/8btQIOaYXZA/s320/hashSetvsDictionary.png" alt="" id="BLOGGER_PHOTO_ID_5343411054445756546" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;" &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-7044140228115744724?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/7044140228115744724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=7044140228115744724' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/7044140228115744724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/7044140228115744724'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2009/05/performance-testing-of-dictionary-list.html' title='Performance testing of Dictionary, List and HashSet'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IUO72aYh3tw/Sh-oG9_5f3I/AAAAAAAAAA0/OC-JtePQ18I/s72-c/1K.png' height='72' width='72'/><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-5836386435258836927</id><published>2009-05-25T13:56:00.003+02:00</published><updated>2009-05-25T14:01:39.499+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='activesync'/><category scheme='http://www.blogger.com/atom/ns#' term='exchange'/><category scheme='http://www.blogger.com/atom/ns#' term='w715'/><title type='text'>Exchange ActiveSync on my SE W715</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_IUO72aYh3tw/ShqIlvKVWHI/AAAAAAAAAAs/v5G_bYFckI8/s1600-h/images.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 61px; height: 150px;" src="http://4.bp.blogspot.com/_IUO72aYh3tw/ShqIlvKVWHI/AAAAAAAAAAs/v5G_bYFckI8/s320/images.jpg" alt="" id="BLOGGER_PHOTO_ID_5339730490097490034" border="0" /&gt;&lt;/a&gt;I got a new phone! After three years of windoze mobile, I decided to go back to a regular phone. But I wanted e-mail, or rather, exchange activesync. So I landed on a Sony Ericsson W715. But after completing my setup, the only message I got was "Session Failed". Huh?&lt;br /&gt;&lt;br /&gt;I found &lt;a href="http://blog.tjitjing.com/index.php/2008/05/exchange-session-failed-communication.html"&gt;a promising blog from a Swede&lt;/a&gt;, but even that (allowing non-provisional devices to use ActiveSync on the Exchange Server) was not enough.&lt;br /&gt;&lt;br /&gt;Finally we found that the connection attempts were being blocked by the ISA server (Microsoft firewall). By allowing All users, not just Authenticated ones, to connect to OWA, I was able to synch my emails.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-5836386435258836927?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/5836386435258836927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=5836386435258836927' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/5836386435258836927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/5836386435258836927'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2009/05/exchange-activesync-on-my-se-w715.html' title='Exchange ActiveSync on my SE W715'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_IUO72aYh3tw/ShqIlvKVWHI/AAAAAAAAAAs/v5G_bYFckI8/s72-c/images.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-6216843032252380610</id><published>2008-04-18T08:42:00.001+02:00</published><updated>2008-04-18T08:48:53.678+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hibernate'/><category scheme='http://www.blogger.com/atom/ns#' term='automatic updates'/><category scheme='http://www.blogger.com/atom/ns#' term='vista'/><category scheme='http://www.blogger.com/atom/ns#' term='windowsupdate'/><title type='text'>Vista, Hibernate and Windows Update</title><content type='html'>My laptop lives a boring life. Every morning, I check news and e-mail before going to work. Then I put the machine in hibernate, just to be able to switch it on in half a minute. Maybe I'll go online while watching tv in the evening, and then it's back to hibernate. But in the middle of the night, my laptop lives it's own life. I started suspected something when I woke up to an empty battery every day. Strange. Annoying.&lt;br /&gt;&lt;br /&gt;I found the problem after some days, when not hibernating, the battery was happy. But what was happening? As far as I know, hibernate means putting the machine in a power-off state - but saving the contents of RAM, enabling us to start from where we left off when we resume. Turns out this can't be quite true. Cause every night at 01:00 AM my computer would turn itself on - because I'd set Vista to check for automatic updates at that time.&lt;br /&gt;&lt;br /&gt;I wasn't quite sure if this was real or not until today, when my colleague Petter showed up at work, telling me had discovered the same thing. His laptop woke him up at 4AM to get the newest updates.&lt;br /&gt;&lt;br /&gt;So if you're having mysterious battery-trouble with a laptop running Vista - check your update settings.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-6216843032252380610?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/6216843032252380610/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=6216843032252380610' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/6216843032252380610'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/6216843032252380610'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2008/04/vista-hibernate-and-windows-update.html' title='Vista, Hibernate and Windows Update'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-7459350597056237469</id><published>2008-03-18T17:27:00.000+01:00</published><updated>2008-03-18T20:04:29.536+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='BACKUP'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='ROW_NUMBER()'/><title type='text'>How do you backup an unknown number of SQL server databases</title><content type='html'>&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;How do you backup an unknown number of SQL server databases?&lt;br /&gt;&lt;br /&gt;Consider a scenario where an application you don’t control is using your SQL server as a place to store data, and this application is creating databases on the fly.&lt;br /&gt;&lt;br /&gt;This can be the case for several types of applications.&lt;br /&gt;&lt;br /&gt;Now, using the built-in maintenance-plan wizard will only get you so far, since it will only apply to the databases already existing on the server at time of creation, not to databases created after the plan, so it will have to be continuously maintained.&lt;br /&gt;&lt;br /&gt;That’s a bad solution, and if forgotten, some databases will not be backed up.&lt;br /&gt;&lt;br /&gt;I will choose to give you two alternatives to solve this problem, the first is using a cursor to accomplish what we want, - and yes, i can already hear you mumbling about “cursor” and words like “ never”, “devils work”, “performance” and “must be some other way” and so on.. – Well, there are several ways to accomplish what we want, and a cursor is one of them, so don’t sharpen the prongs of your pitchfork just yet, i will explain later. Another way is using 2005’s new row_number() function and a in-memory table variable, and a standard execute (@sqlcommand) and this is also a very effective way.&lt;br /&gt;&lt;br /&gt;Using a cursor for a backup task that is to run maybe once every night, or every Sunday after midnight is quite ok, the performance problem with cursors is widely agreed upon and I will not argue that they are not, but this is not a procedure that will be called by sixty thousand web users every minute, if that was the case, I would also abandon cursors, but in this case, it’s not such a bad idea.&lt;br /&gt;So to the first code snippet: we will call this: DoDatabaseBackup1&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;create proc DoDatabaseBackup1&lt;br /&gt;as&lt;br /&gt;declare @DBname varchar(254) &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;declare @Fixedpath varchar(254)&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;declare @FileName varchar(254) &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;set @Fixedpath = 'c:\sqlbackup\' &lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;declare getDBName cursor for&lt;br /&gt;select [name] from sys.databases &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#cccccc;"&gt;&lt;br /&gt;&lt;/span&gt;where [name] NOT IN ('master','model','msdb','tempdb') &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;open getDBName &lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#cccccc;"&gt;&lt;br /&gt;&lt;/span&gt;fetch next from getDBName into @DBname&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;&lt;span style="font-size:85%;"&gt;while @@fetch_status = 0&lt;br /&gt;begin&lt;br /&gt;set @fileName = @Fixedpath + @DBname + '_' + convert(varchar(8),getdate(),112) + '.bak'&lt;br /&gt;backup database @DBname to disk = @fileName &lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;fetch next from getDBName into @DBname &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;end&lt;br /&gt;&lt;br /&gt;close getDBName&lt;br /&gt;deallocate getDBName&lt;/span&gt; &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;This procedure will loop through any user-databases there is on the server and place a backup file of each on the location of your choice, simple as that. Not big, not difficult to understand and works like a charm. Create a scheduled job under sql-server agent and you should be home free. (and the cursor performance problem is not what will take time here, the backup of each database will take considerably more out of the server…)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;But, since cursor IS the work of the devil :), to solution number two:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="font-size:85%;"&gt;This one is called (who would guess): DoDatabaseBackup2&lt;br /&gt;&lt;br /&gt;The logic is more or less the same, but instead of a cursor we use a table-variable and then use this to build a sql-command-string.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;create proc DoDatabaseBackup2&lt;br /&gt;as&lt;br /&gt;declare @sqlstr varchar(max)&lt;br /&gt;declare @userdbs int&lt;br /&gt;declare @counter int&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;declare @fixedpath varchar(254) &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#cccccc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;declare @dbnames table (dbrow int,dbname varchar(254)) &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;set @counter=1&lt;br /&gt;set @sqlstr=''&lt;br /&gt;&lt;br /&gt;set @fixedpath='c:\sqlbackup\'&lt;br /&gt;&lt;br /&gt;insert into @dbnames&lt;br /&gt;select row_number() over(order by [name]) as dbrow,[name]&lt;br /&gt;from sys.databases&lt;br /&gt;where [name] not in ('master','tempdb','model','msdb') &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#cccccc;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;set @userdbs=@@rowcount&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;if @userdbs&gt;0&lt;br /&gt;begin&lt;br /&gt;while @counter&lt;=@userdbs begin select @sqlstr=@sqlstr+(select 'backup database '+dbname+' to disk = '''+@fixedpath+dbname+'_'+Convert(char(8),getdate(),112)+'.bak'';' from @dbnames where dbrow=@counter) &lt;/span&gt;&lt;span style="color:#cccccc;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:verdana;"&gt;&lt;span style="color:#000099;"&gt;&lt;strong&gt;&lt;span style="font-size:85%;"&gt;set @counter=@counter+1&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;br /&gt;end&lt;br /&gt;end&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;exec (@sqlstr) &lt;/span&gt;&lt;/strong&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;Both of this procedures will result in the same, a backup of all userdatabases regardless of name and numbers, and you don’t even have to know anything exept that there is space available on the receiving location..&lt;br /&gt;&lt;br /&gt;Other solutions also exist, but this will do for now….&lt;br /&gt;&lt;br /&gt;/Leo &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-7459350597056237469?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/7459350597056237469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=7459350597056237469' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/7459350597056237469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/7459350597056237469'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2008/03/how-do-you-backup-unknown-number-of-sql.html' title='How do you backup an unknown number of SQL server databases'/><author><name>Leo</name><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-3606597030942128101.post-2173575497571403366</id><published>2008-02-22T14:02:00.000+01:00</published><updated>2008-02-22T14:32:38.180+01:00</updated><title type='text'>Where is my SQL Server Management Studio?</title><content type='html'>If you should stumble across this blog, I bet you have encountered the same problem I did. After you installed the Microsoft SQL Server 2005 you cannot find the SQL Server Management Studio in your Start menu, and if you try to search for the SqlWb.exe it's nowhere to be found. In my situation I had installed Visual Studio 2003, Visual Studio 2005 and Visual Studio 2008 prior to the SQL installation.&lt;br /&gt;&lt;br /&gt;The problem is that the installation of the SQL server will interpret the installation of the SQL Express Edition as a newer version or an already installed client tool.&lt;br /&gt;&lt;br /&gt;So the solution for you may be to uninstall the SQL Express. I had a Windows 2003 64x Server so I had to uninstall (via the Add or Remove programs) the "Microsoft SQL Server 2005" (which was the Express instance, installed by Visual Studio 2005/2008). I then reran the SQL Server 2005 installation and ensured that the Client tools were selected (click the advanced button in the installation wizard).&lt;br /&gt;&lt;br /&gt;After this I had the Management Tools back on the machine, but now I couldn't open the Express database in my VS 2005 project so I had to install the SQL Express again by rerunning(updating) the Visual Studio 2008.&lt;br /&gt;&lt;br /&gt;Happy sqling and programming&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-2173575497571403366?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/2173575497571403366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=2173575497571403366' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/2173575497571403366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/2173575497571403366'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2008/02/where-is-my-sql-server-management.html' title='Where is my SQL Server Management Studio?'/><author><name>Petter Søreide</name><uri>http://www.blogger.com/profile/08679516975056044805</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-3606597030942128101.post-4242934824966304403</id><published>2008-02-12T13:44:00.000+01:00</published><updated>2008-02-14T08:52:33.829+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='delegates'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='threading'/><title type='text'>Illegal Cross Thread Operation?</title><content type='html'>I see many forumposts solving this problem by simply adding the CheckForIllegalCrossThreadOperations=false;&lt;br /&gt;&lt;br /&gt;While this is a totally legit workaround, it is highly thread-unsafe, and should only be used for debugging purposes. To be able to update for instance form-components from another thread, you will need to use delegates and invoke. Sounds scary? Not really.&lt;br /&gt;&lt;br /&gt;A delegate is simply a "blueprint" that describes how a particular function or method should look. In C++ world, delegates are similar to Function pointers, but since we don't work with pointers in C# this is the closest we get. Still, function pointer is not a correct definition, as the delegate won't point to a function unless you make it do so. Here's an example:&lt;br /&gt;&lt;br /&gt;The function&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;private void&lt;/span&gt; UpdateStatusText(&lt;span style="color:blue;"&gt;string &lt;/span&gt;statusText)&lt;br /&gt;{&lt;br /&gt;statusLabel.Text = statusText;&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Would have the following delegate:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;public delegate void &lt;/span&gt;&lt;span style="color:teal;"&gt;UpdateStatusTextHandler&lt;/span&gt;(&lt;span style="color:blue;"&gt;string&lt;/span&gt; statusText);&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Both the delegate name and the parameter-name(s) are totally random, it is the return-type and parameter-types that are important.&lt;br /&gt;&lt;br /&gt;Let's say we have an eventhandler thread_OnStatusChanged(string newStatus) that needs to update the statusLabel.Text property. If the thread is different from the one the statusLabel exists in, you will get the Illegal Cross Thread operation error if you simply try to update it.&lt;br /&gt;&lt;br /&gt;What we first want to do is an if-check to see if it comes from a different thread.&lt;br /&gt;Inside the thread_OnStatusChanged eventhandler we do the following:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;span style="color:blue;"&gt;if &lt;/span&gt;(statusLabel.InvokeRequired)&lt;br /&gt;{&lt;br /&gt;statusLabel.Invoke(&lt;span style="color:blue;"&gt;new &lt;span style="color:teal;"&gt;UpdateStatusTextHandler&lt;/span&gt;&lt;span style="color:black;"&gt;(UpdateStatusText), newStatus);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Invoke function takes the arguments Delegate Method, as well as the optional args[] to enable you to pass the required arguments to your method.&lt;br /&gt;&lt;br /&gt;So by doing the &lt;span style="font-family:courier new;color:blue;"&gt;new &lt;span style="color:teal;"&gt;UpdateStatusTextHandler&lt;/span&gt;&lt;span style="color:black;"&gt;(UpdateStatusText)&lt;/span&gt;&lt;/span&gt; you are simply creating a pointer to the method &lt;span style="font-family:courier new;color:black;"&gt;UpdateStatusText(&lt;span style="color:blue;"&gt;string&lt;/span&gt; statusText)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;color:blue;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Hopefully this will make delegates and invoking a little more understandable.&lt;br /&gt;&lt;br /&gt;Good luck with your threads!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-4242934824966304403?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/4242934824966304403/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=4242934824966304403' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/4242934824966304403'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/4242934824966304403'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2008/02/illegal-cross-thread-operation.html' title='Illegal Cross Thread Operation?'/><author><name>Yngve B. Nilsen</name><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-3606597030942128101.post-641339537973884215</id><published>2008-02-06T10:40:00.000+01:00</published><updated>2008-02-14T08:53:33.183+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='collection'/><category scheme='http://www.blogger.com/atom/ns#' term='resources'/><category scheme='http://www.blogger.com/atom/ns#' term='Dispose'/><category scheme='http://www.blogger.com/atom/ns#' term='collector collection'/><category scheme='http://www.blogger.com/atom/ns#' term='IDisposable'/><category scheme='http://www.blogger.com/atom/ns#' term='Garbage collector'/><category scheme='http://www.blogger.com/atom/ns#' term='unmanaged resources'/><title type='text'>Managing Unmanaged Resources</title><content type='html'>Unmanaged Resources are objects that are not garbage collected, which means that they are not reclaimed by the system when the garbage collector cleans up after you.&lt;br /&gt;&lt;br /&gt;But are Unmanaged Resources resources outside .NET framework like DLL used through interop? No, unmanaged resources can also be database connection. It is a common mistake by programmers not to close the connection when finished working with it, in misconception that the garbage collection will close it.&lt;br /&gt;&lt;br /&gt;So how do I identify if the object is an unmanaged resource? If the object implement the IDisposable interface it have an unmanaged resource and you need to call the IDisposable.Dispose() method to clean the objects unmanaged resource.&lt;br /&gt;If you use the object in a single call you can wrap it in a using statement (&lt;a href="http://softscenario.blogspot.com/2007/10/using-using.html"&gt;http://softscenario.blogspot.com/2007/10/using-using.html&lt;/a&gt;), and it will call the Dispose() method for you. If you keep the object for a longer time you must support the IDisposable interface in your class, and in your implementation of the Idisposable.Dispose() call the member's IDisposable method.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Remember to look for the IDisposable interface in the classes you use in your development. You will be surprised how many classes that do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-641339537973884215?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/641339537973884215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=641339537973884215' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/641339537973884215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/641339537973884215'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2008/02/managing-unmanaged-resources.html' title='Managing Unmanaged Resources'/><author><name>Petter Søreide</name><uri>http://www.blogger.com/profile/08679516975056044805</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-3606597030942128101.post-4391947091996801730</id><published>2008-02-06T09:25:00.000+01:00</published><updated>2008-02-07T12:35:06.403+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='user.config properties.settings user settings'/><title type='text'>Where are my Properties.Settings saved</title><content type='html'>Have you ever wondered where your user settings are saved from an .NET application? You would probably think that it's saved in the [application].exe.config(located in your application folder) file, but this is only partially true. The default values you create in Visual Studio are saved in this file. But if you change these settings at runtime:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;Properties.&lt;span style="color:#339999;"&gt;Settings&lt;/span&gt;.Default.myValue = "MyNewValue";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;Properties.&lt;span style="color:#339999;"&gt;Settings&lt;/span&gt;.Default.Save();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;they are saved to a different location. Namely the User.config file:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;C:\Documents and Settings\[USER]\Local Settings\Application Data\[company]\[applicationname]\[version]&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note&lt;/strong&gt; that if you should change the company name or AssemblyVersion attribute in your AssemblyInfo.cs your Settings will be saved in a new location.&lt;br /&gt;&lt;br /&gt;Since you do not override the default settings in the exe.config file, you can call the reset() method to restore the settings to its original state:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;font-size:85%;"&gt;Properties.&lt;span style="color:#339999;"&gt;Settings&lt;/span&gt;.Default.Reset();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;font-size:85%;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-4391947091996801730?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/4391947091996801730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=4391947091996801730' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/4391947091996801730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/4391947091996801730'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2008/02/where-is-my-propertiessettings-saved.html' title='Where are my Properties.Settings saved'/><author><name>Petter Søreide</name><uri>http://www.blogger.com/profile/08679516975056044805</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-3606597030942128101.post-2125893888464132715</id><published>2008-01-31T16:09:00.000+01:00</published><updated>2008-02-13T13:35:18.110+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='event'/><category scheme='http://www.blogger.com/atom/ns#' term='eventhandler'/><category scheme='http://www.blogger.com/atom/ns#' term='generics'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='linq'/><title type='text'>Reflecting on reflection</title><content type='html'>Some weeks ago I was working on a project where we receive some ten or twenty different message types from a server, and they all need to be handled when they arrive. Of course, we want to use event driven programming to make this happen on the fly, instead of polling all the time.&lt;br /&gt;&lt;br /&gt;All of the messages have the header in common, so we already made a abstract parent class called Message, and when it came to handling all the different messages, we wanted to write as little code as possible. So we added an abstract method called HandleResponse to the code.&lt;br /&gt;&lt;br /&gt;So the idea was to identify the incoming message type and invoke the HandleResponse using reflection on the object that we had identified this as. To do this, we made a little xml file that contains the message code (A-Z) along with the name and reference to the class linked to the message type. When the program starts, it reads the xml into a dictionary, so we can look up the key (message code) and get the class reference in return.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;XDocument &lt;/span&gt;descriptorsXml = &lt;span style="color: rgb(51, 153, 153);"&gt;XDocument&lt;/span&gt;.Load( &lt;span style="color: rgb(153, 0, 0);"&gt;@".\Data\MessageDescriptors.xml"&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     &lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;var &lt;/span&gt;descQuery = &lt;span style="color: rgb(51, 51, 255);"&gt;from &lt;/span&gt;desc &lt;span style="color: rgb(51, 51, 255);"&gt;in &lt;/span&gt;descriptorsXml.Descendants(&lt;span style="color: rgb(153, 0, 0);"&gt;"Message"&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                &lt;span style="color: rgb(51, 51, 255);"&gt;    select new&lt;/span&gt; &lt;span style="color: rgb(51, 153, 153);"&gt;MessageDescriptor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        Code = desc.Element(&lt;span style="color: rgb(153, 0, 0);"&gt;"Code"&lt;/span&gt;).Value,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        Name = desc.Element(&lt;span style="color: rgb(153, 0, 0);"&gt;"Name"&lt;/span&gt;).Value,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        ObjectType = desc.Element(&lt;span style="color: rgb(153, 0, 0);"&gt;"ObjectType"&lt;/span&gt;).Value.ToType() ,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        IsServerMessage = &lt;span style="color: rgb(51, 153, 153);"&gt;Convert&lt;/span&gt;.ToBoolean(     desc.Element(&lt;span style="color: rgb(153, 0, 0);"&gt;"IsServerMessage"&lt;/span&gt;).Value )&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    };&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;foreach &lt;/span&gt;(&lt;span style="color: rgb(51, 153, 153);"&gt;MessageDescriptor &lt;/span&gt;m in descQuery)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      descriptors.Add(m.Code, m);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Then, we have a MessageHandlingFactory that simply gets objects in from a queue, identifies the type, and invokes the HandleResponse. If the object isn't recognized (could be a new message type, or could be that the programmer forgot to insert the description in the XML file), the MessageHandlingFactory can either throw an exception, or better yet, return a string with message that tells the user what went wrong. If everything goes as planned, it returns a string with the identified typename.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;object&lt;/span&gt; &lt;/span&gt;theType = &lt;span style="color: rgb(51, 153, 153);"&gt;Activator&lt;/span&gt;.CreateInstance(t, SessionID);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;EventInfo&lt;/span&gt; eInfo = t.GetEvent(&lt;span style="color: rgb(153, 51, 0);"&gt;"OnWriteEvent"&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="color: rgb(51, 153, 153);"&gt;Message.WriteEventHandler&lt;/span&gt; theHandler = &lt;span style="color: rgb(0, 0, 153);"&gt;new&lt;/span&gt; &lt;span style="color: rgb(51, 153, 153);"&gt;Message.WriteEventHandler&lt;/span&gt;(OnWriteEventHandler);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;eInfo.AddEventHandler(theType, theHandler);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;theType.GetType().GetMethod(&lt;span style="color: rgb(153, 51, 0);"&gt;"HandleResponse"&lt;/span&gt;).Invoke(theType, &lt;span style="color: rgb(0, 0, 153);"&gt;new object&lt;/span&gt;[] { message });&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(153, 51, 0);"&gt;"MessageHandler: "&lt;/span&gt; + messageType;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:georgia;font-size:100%;"  &gt;That's all, folks!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update February 13, 2008:&lt;/span&gt; The code has now been tested in a very high throughput environment, and it performs flawlessly! There's no indication of latency even after invoking some millions of objects. And with that amount of data, everything counts. I'll not vouch for the objects that you choose to invoke, though ;)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-2125893888464132715?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/2125893888464132715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=2125893888464132715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/2125893888464132715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/2125893888464132715'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2008/01/reflecting-on-reflection.html' title='Reflecting on reflection'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-643477513157282062</id><published>2007-11-28T11:36:00.000+01:00</published><updated>2007-11-28T12:11:42.669+01:00</updated><title type='text'>SQL 2005 Server Side Paging using CTE (Common Table Expression)</title><content type='html'>When a application want to show the result from an SQL-query as a paged view, i.e. showing ten or fifteen result on first page, then have a "next" function to show the next page of results.&lt;br /&gt;&lt;br /&gt;To minimize traffic over the network, it is best practice to do the paging on the SQL-server, so that only the results you want to show is sendt to the application.&lt;br /&gt;&lt;br /&gt;With SQL Server 2005 this is quite easy using the new CTE capabilities and the new ROW_NUMBER() function.&lt;br /&gt;&lt;br /&gt;(using the AdventureWorks example database for SQL-2005 &lt;a href="http://codeplex.com/"&gt;http://codeplex.com/&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Consider the following T-SQL to select out all employees from Person.Contact:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;color:#006600;"&gt;SELECT [FirstName]&lt;br /&gt;,[MiddleName]&lt;br /&gt;,[LastName]&lt;br /&gt;,[EmailAddress]&lt;br /&gt;FROM [Person].[Contact]&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;This will result in 19972 rows returned, and the paging logic has to be done on the client application. &lt;/span&gt;&lt;span style="color:#000000;"&gt;not good.. so first we implement the ROW_NUMBER() function like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#006600;"&gt;SELECT ROW_NUMBER() OVER (Order by [Person].[Contact].[LastName]) AS RowID,&lt;br /&gt;[FirstName]&lt;br /&gt;,[MiddleName]&lt;br /&gt;,[LastName]&lt;br /&gt;,[EmailAddress]&lt;br /&gt;FROM [Person].[Contact]&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;This will create a unique RowID for each row in the result.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now we need to wrap the result in a CTE using just the &lt;span style="font-size:85%;color:#006600;"&gt;WITH [ctename] AS ()&lt;/span&gt; statement:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#006600;"&gt;WITH AllEmployees AS&lt;br /&gt;(SELECT ROW_NUMBER() OVER (Order by [Person].[Contact].[LastName]) AS RowID,&lt;br /&gt;[FirstName]&lt;br /&gt;,[MiddleName]&lt;br /&gt;,[LastName]&lt;br /&gt;,[EmailAddress]&lt;br /&gt;FROM [Person].[Contact])&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Now we have all the Employees in a in-memory table called AllEmployees, and we can select from this table as any other table, with all the common clauses. Simplest term:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#006600;"&gt;SELECT [FirstName]&lt;br /&gt;,[MiddleName]&lt;br /&gt;,[LastName]&lt;br /&gt;,[EmailAddress]&lt;br /&gt;FROM AllEmployees&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then, to use this for a Server-side paging solution, the simplest way we use the RowID to establish what rows to return, either by using &lt;span style="color:#006600;"&gt;&lt;span style="font-size:85%;"&gt;DECLARE [varname]&lt;/span&gt; &lt;/span&gt;&lt;span style="color:#000000;"&gt;or by putting the whole code into a Parameterized StoredProcedure like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#006600;"&gt;CREATE PROC GetPagedEmployees (@NumbersOnPage INT=25,@PageNumb INT = 1)&lt;br /&gt;AS BEGIN&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#006600;"&gt;WITH AllEmployees AS&lt;br /&gt;(SELECT ROW_NUMBER() OVER (Order by [Person].[Contact].[LastName]) AS RowID,&lt;br /&gt;[FirstName],[MiddleName],[LastName],[EmailAddress] FROM [Person].[Contact])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#006600;"&gt;SELECT [FirstName],[MiddleName],[LastName],[EmailAddress] &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#006600;"&gt;FROM AllEmployees WHERE RowID BETWEEN &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#006600;"&gt;((@PageNumb - 1) * @NumbersOnPage) + 1 AND @PageNumb * NumbersOnPage&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#006600;"&gt;ORDER BY RowID&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#006600;"&gt;END&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#006600;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;The parameter for this procedure is used for the paging and when executed it will return a result based on how many results per page, and what page number to return, like this:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;color:#006600;"&gt;EXEC GetPagedEmployees 15,2&lt;/span&gt; -- will return 15 employees from id = 16 and up (page 2)&lt;br /&gt;&lt;br /&gt;This technique can be used for all type of results where you want to return a fixed number of results, paged server-side.&lt;br /&gt;&lt;br /&gt;/Leo&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-643477513157282062?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/643477513157282062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=643477513157282062' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/643477513157282062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/643477513157282062'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2007/11/sql-2005-server-side-paging-using-cte.html' title='SQL 2005 Server Side Paging using CTE (Common Table Expression)'/><author><name>Leo</name><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>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-835289477730149452</id><published>2007-11-28T09:27:00.000+01:00</published><updated>2007-11-28T09:40:57.667+01:00</updated><title type='text'>Remote desktop stops working</title><content type='html'>Suddenly my workstation wouldn't accept incoming remote desktop sessions. I first thought it was because I was connecting from a Vista computer, but as it turned out, I couldn't even connect from other 2003 servers. The event log only said this:&lt;br /&gt;&lt;br /&gt;Application popup: : \SystemRoot\System32\RDPDD.dll failed to load&lt;br /&gt;&lt;br /&gt;Which was not very helpful! After googling around quite a bit, I had tried reinstalling the RDP software's latest version and rebooted, when I found multiple people describing the same problem and fixing it by removing their ATI video drivers... As I have a nvidia card, I first thought it had nothing to do with this. However... there wasn't much else to try.  I uninstalled the Asus Enhanced Video  Driver and the nvidia drivers - and then it worked. Crazy. Worst part is, now I've reinstalled the video driver,  and remote desktop still works. Huh.&lt;br /&gt;&lt;br /&gt;So it could be that Asus Enhanced Video Driver is the culprit. I won't try and find out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-835289477730149452?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/835289477730149452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=835289477730149452' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/835289477730149452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/835289477730149452'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2007/11/remote-desktop-stops-working.html' title='Remote desktop stops working'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-8272026678182210490</id><published>2007-11-01T09:31:00.001+01:00</published><updated>2007-11-01T09:35:02.248+01:00</updated><title type='text'>IIS and .net 3.5 beta 2</title><content type='html'>We installed .net 3.5 beta 2 on a web server this morning. It did not work. Even our 2.0 webs stopped working. So to save others the trouble...&lt;br /&gt;Go ahead to&lt;br /&gt;%WINDIR%\Microsoft.NET\Framework\v.2.0.something...\CONFIG\web.config&lt;br /&gt;&lt;br /&gt;Go ahead and remove all instances of   xmlns="" and you're good to go!&lt;br /&gt;&lt;br /&gt;Also worth mentioning, 3.5 and 3.0 does not appear in the ASP.NET tag on IIS, only 2.0 does. This is because 3.0 and 3.5 are extensions of the 2.0 framework.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-8272026678182210490?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/8272026678182210490/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=8272026678182210490' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/8272026678182210490'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/8272026678182210490'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2007/11/iis-and-net-35-beta-2.html' title='IIS and .net 3.5 beta 2'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-39592624464327248</id><published>2007-10-19T10:54:00.000+02:00</published><updated>2007-10-19T10:57:12.430+02:00</updated><title type='text'>Online MachineKey Generator</title><content type='html'>Found this today, when creating MachineKey for a web farm on ASP.NET:&lt;br /&gt;&lt;a href="http://www.orcsweb.com/articles/aspnetmachinekey.aspx"&gt;http://www.orcsweb.com/articles/aspnetmachinekey.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Will save you some time when creating webapps that run in a web farm environment, and it does work.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-39592624464327248?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/39592624464327248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=39592624464327248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/39592624464327248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/39592624464327248'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2007/10/online-machinekey-generator.html' title='Online MachineKey Generator'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-3199498248975582903</id><published>2007-10-19T10:39:00.000+02:00</published><updated>2007-10-19T11:51:27.306+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='session_end'/><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='session'/><title type='text'>Session_End and SessionState mode="SQLServer"</title><content type='html'>A webapp I'm working on now needs to keep track of the number of logged in users at any time. We used to rely on Session_End for deleting sessions. However, this turned out to work only if the SessionState mode was set to InProc.  For other scenarios, Session_End is simply not called. Ever.&lt;br /&gt;&lt;br /&gt;So we programmed a background service that polls the database now and then, and  deletes from our table the rows that don't exist in the AspState-database (AspState obviously keeps track of timed out sessions and removes them from the table). Clean and simple solution.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-3199498248975582903?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/3199498248975582903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=3199498248975582903' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/3199498248975582903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/3199498248975582903'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2007/10/sessionend-and-sessionstate.html' title='Session_End and SessionState mode=&quot;SQLServer&quot;'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3606597030942128101.post-405321160314292278</id><published>2007-10-16T11:00:00.000+02:00</published><updated>2007-11-28T14:27:22.033+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp.net'/><category scheme='http://www.blogger.com/atom/ns#' term='interfaces'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Using using</title><content type='html'>When writing code that makes use of alot of unmanaged memory resources, all objects should be disposed of before exiting methods and such. The keyword using is often forgotten, and also sometimes seen as messy. example:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3333ff;"&gt;using&lt;/span&gt; (&lt;span style="color:#00cccc;"&gt;Bitmap&lt;/span&gt; bitmap1 = new &lt;span style="color:#00cccc;"&gt;Bitmap&lt;/span&gt;(100, 100))&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.WriteLine&lt;span style="color:#990000;"&gt;("Width:{0}, Height:{1}"&lt;/span&gt;, bitmap1.Width, bitmap1.Height);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;should basically be the same as&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#00cccc;"&gt;Bitmap&lt;/span&gt; bitmap1 = &lt;span style="color:#3333ff;"&gt;new&lt;/span&gt; &lt;span style="color:#00cccc;"&gt;Bitmap&lt;/span&gt;(100, 100)&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.WriteLine&lt;span style="color:#990000;"&gt;("Width:{0}, Height:{1}"&lt;/span&gt;, bitmap1.Width, bitmap1.Height);&lt;br /&gt;bitmap1.Dispose();&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;shouldn't it?&lt;br /&gt;No, not really... The using-clause does a little more than this. Actually, my using-example is equivalent to the following block of code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color:#3366ff;"&gt;&lt;span style="color:#00cccc;"&gt;Bitmap&lt;/span&gt; &lt;/span&gt;bitmap1 = &lt;span style="color:#3366ff;"&gt;new&lt;/span&gt; &lt;span style="color:#00cccc;"&gt;Bitmap&lt;/span&gt;(100, 100);&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;try&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color:#990000;"&gt;"Width:{0}, Height:{1}"&lt;/span&gt;, bitmap1.Width, Bitmap1.Height);&lt;br /&gt;}&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;finally&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;if&lt;/span&gt; (bitmap1 != &lt;span style="color:#3366ff;"&gt;null&lt;/span&gt;)&lt;br /&gt;{&lt;br /&gt;bitmap1.Dispose();&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;span style="color:#00cccc;"&gt;Console&lt;/span&gt;.ReadLine(); &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Imagine writing nested using-clauses, and try writing the expanded code for that :)&lt;br /&gt;Using using really cleans up your code, &lt;strong&gt;and&lt;/strong&gt; your memory. So use it!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Edit: Oh, as Stian commented. Using should be used for all objects that implements the IDisposable interface. But remember - if you plan on implementing this interface on your own classes, you need to make sure it fully implements all the necessary methods for cleaning up. Otherwise it will all be to waste :)&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-405321160314292278?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/405321160314292278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=405321160314292278' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/405321160314292278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/405321160314292278'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2007/10/using-using.html' title='Using using'/><author><name>Yngve B. Nilsen</name><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-3606597030942128101.post-2884759445421363797</id><published>2007-10-15T14:14:00.000+02:00</published><updated>2007-10-19T11:52:15.031+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stored procedures'/><category scheme='http://www.blogger.com/atom/ns#' term='linq'/><title type='text'>LINQ and Stored Procedures</title><content type='html'>Just starting off with LINQ, I've already found a strange behavior. In my SP, I have to select some blank columns, that used to exist in the table. Now, they're only there to stop old apps from crashing:&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span&gt;&lt;span&gt;Select&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt; '' &lt;span&gt;as&lt;/span&gt; inst &lt;span&gt;from&lt;/span&gt; footable&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This made Linq return only a cryptic error message:&lt;br /&gt;&lt;span&gt;System.FormatException: String must be exactly one character long.&lt;br /&gt;at System.Data.Linq.DBConvert.ChangeType(Object obj, Type type)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;But when I replaced the '' in the SP with a ' ' (that is, added a blank space) - everything works. So it looks as if Linq is trying to type every column in the result, and if it's empty, it dies.&lt;br /&gt;&lt;br /&gt;Oh, and if you have a variable named @@foo in your script - I don't know why it was called @@foo, it just was - Linq will not be able to run it! It presumes that all variables are named @foo, which probably is the correct SQL, by the way. But - the error message, again, is not so helpful: The procedure expects the parameter "foo", which was not provided.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3606597030942128101-2884759445421363797?l=softscenario.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://softscenario.blogspot.com/feeds/2884759445421363797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=3606597030942128101&amp;postID=2884759445421363797' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/2884759445421363797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3606597030942128101/posts/default/2884759445421363797'/><link rel='alternate' type='text/html' href='http://softscenario.blogspot.com/2007/10/linq-and-stored-procedures.html' title='LINQ and Stored Procedures'/><author><name>Stian Sveen</name><uri>http://www.blogger.com/profile/09962823462714052499</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://4.bp.blogspot.com/-MHP5Zp48Xpw/TaMGf-O3NAI/AAAAAAAAACY/HNvzJMwrKWQ/s220/sveen.jpg'/></author><thr:total>1</thr:total></entry></feed>
