<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">saurabhd's musings</title><subtitle type="html">Saurabh Dasgupta works for Microsoft Consulting Services. - '640kb ought to be enough for anybody'</subtitle><id>http://blogs.msdn.com/saurabhd/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/saurabhd/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2006-07-30T01:35:00Z</updated><entry><title>Powershell:Reading the header columns in a .CSV file using import-csv cmdlet</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2009/11/25/powershell-reading-the-header-columns-in-a-csv-file-using-import-csv-cmdlet.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2009/11/25/powershell-reading-the-header-columns-in-a-csv-file-using-import-csv-cmdlet.aspx</id><published>2009-11-25T11:46:00Z</published><updated>2009-11-25T11:46:00Z</updated><content type="html">As my journey into the wonderland of Powershell continues, I stumbled upon the need to read the list of header columns from a .CSV file. You would have already used import-csv to read the content of a .CSV file. What a beauty! If you need to know the column headers in the file, you can try this approach: $headers=import-csv sample.csv | gm -member noteproperty foreach ($headerline in $headers) { out-host -Inputobject $headerline.name } I thank my colleagues at Microsoft for giving me this tip....(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2009/11/25/powershell-reading-the-header-columns-in-a-csv-file-using-import-csv-cmdlet.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9923406" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>Comparing the processing power of servers in your Performance testing farm</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2009/11/16/comparing-the-processing-power-of-servers-in-your-performance-testing-farm.aspx" /><link rel="enclosure" type="application/octet-stream" length="6046" href="http://blogs.msdn.com/saurabhd/attachment/9897245.ashx" /><id>http://blogs.msdn.com/saurabhd/archive/2009/11/16/comparing-the-processing-power-of-servers-in-your-performance-testing-farm.aspx</id><published>2009-11-16T22:11:00Z</published><updated>2009-11-16T22:11:00Z</updated><content type="html">Think of this scenario. You are into a performance tuning engagement. You are given two servers which are supposed to be playing the role of hosting ASP.NET applications. You implement load balancing. You test the servers for distribution of web requests. All has gone well so far. Now time for the acid test. You perform a load test on your server farm by gradually increasing the client injected load. What do you see? After a point, the web servers are not evenly loaded anymore. The performance counter...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2009/11/16/comparing-the-processing-power-of-servers-in-your-performance-testing-farm.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9897245" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>Querying SQL server from Powershell scripts</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2009/11/16/querying-sql-server-from-powershell-scripts.aspx" /><link rel="enclosure" type="text/plain" length="1025" href="http://blogs.msdn.com/saurabhd/attachment/9923168.ashx" /><id>http://blogs.msdn.com/saurabhd/archive/2009/11/16/querying-sql-server-from-powershell-scripts.aspx</id><published>2009-11-16T21:36:00Z</published><updated>2009-11-16T21:36:00Z</updated><content type="html">I was trying to figure out a way to invoke custom SQL queries from a Powershell script and process the data within the script. I wanted something more powerful than executing queries from SQLCMD.EXE. My scenario required me to take an action based on the value of a particular row in the table. I got the answer after a bit of trawling the internet. -:) Here is an example: ############################################################################### # # # This script queries the LoadTestCase table...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2009/11/16/querying-sql-server-from-powershell-scripts.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9923168" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>Powershell - Your friend for Performance Testing projects</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2009/09/14/Powershell-_2D00_-Your-friend-for-Performance-Testing-projects.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2009/09/14/Powershell-_2D00_-Your-friend-for-Performance-Testing-projects.aspx</id><published>2009-09-15T01:22:00Z</published><updated>2009-09-15T01:22:00Z</updated><content type="html">I am into an intensive performance testing project, one of the activities involves load testing Web services using Visual Studio Team Edition for Tester. The performance rig has 2 web servers, 2 database servers and 4 BizTalk servers. Writing the unit test for the web service and then authoring a web service was no big deal. The real challenge came when I had to carry out several house keeping tasks ,such as the ones listed here and consistently execute these tasks for each performance test run:...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2009/09/14/Powershell-_2D00_-Your-friend-for-Performance-Testing-projects.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9884218" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author><category term="Powershell" scheme="http://blogs.msdn.com/saurabhd/archive/tags/Powershell/default.aspx" /></entry><entry><title>An approach towards implementing information entry forms using Silverlight and SharePoint-Part 2</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2009/02/11/an-approach-towards-implementing-information-entry-forms-using-silverlight-and-sharepoint-part-2.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2009/02/11/an-approach-towards-implementing-information-entry-forms-using-silverlight-and-sharepoint-part-2.aspx</id><published>2009-02-11T03:27:00Z</published><updated>2009-02-11T03:27:00Z</updated><content type="html">Recap of Part 1 This is a continuation of Part 1 of the article. In the first part we discussed about a Expense entry form created using Silverlight. We discussed how it could be hosted on a dynamically created SharePoint page (web part page) using a generic Silverlight Application web part. We uploaded the .XAP file to a custom Document Library and configured the Web Part's properties in the Design Mode of the form so that it reads the XAP file from the custom document library with the appropriate...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2009/02/11/an-approach-towards-implementing-information-entry-forms-using-silverlight-and-sharepoint-part-2.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9411303" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>An approach towards implementing information entry forms using Silverlight and SharePoint-Part 1</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2009/01/15/implementing-business-forms-using-silverlight-and-windows-sharepoint-services.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2009/01/15/implementing-business-forms-using-silverlight-and-windows-sharepoint-services.aspx</id><published>2009-01-16T00:33:00Z</published><updated>2009-01-16T00:33:00Z</updated><content type="html">In this article , I have envisioned a solution which marries the RIA capabilities of Silverlight and the portal/document management features of Windows SharePoint Services 3.0 ...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2009/01/15/implementing-business-forms-using-silverlight-and-windows-sharepoint-services.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9304918" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author><category term="sharepoint" scheme="http://blogs.msdn.com/saurabhd/archive/tags/sharepoint/default.aspx" /><category term="silverlight" scheme="http://blogs.msdn.com/saurabhd/archive/tags/silverlight/default.aspx" /></entry><entry><title>An approach towards centralized web.config management in WSS/MOSS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2008/12/13/An-approach-towards-centralized-web.config-management-in-WSS_2F00_MOSS.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2008/12/13/An-approach-towards-centralized-web.config-management-in-WSS_2F00_MOSS.aspx</id><published>2008-12-13T04:26:00Z</published><updated>2008-12-13T04:26:00Z</updated><content type="html">Introduction Let me be very frank with you. I love WSS 30/MOSS technologies. Building a portal for sharing information and collaborating has been made so simple with WSS/MOSS. The architects of WSS/MOSS rightly chose to build over the foundations provided by ASP.NET. Like any ASP.NET application, the web.config file plays a very important role in WSS/MOSS in carrying out low level technical customizations. WSS/MOSS web.config files can be humungous. Try as much I can, I invariably need more than...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2008/12/13/An-approach-towards-centralized-web.config-management-in-WSS_2F00_MOSS.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9166766" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>WSS/MOSS Certifications - I did it</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2008/12/04/wss-moss-certifications-i-did-it.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2008/12/04/wss-moss-certifications-i-did-it.aspx</id><published>2008-12-05T01:03:00Z</published><updated>2008-12-05T01:03:00Z</updated><content type="html">Years ago I used to be skeptical of certifications. My argument with my manager was that you learn stuff doing things hands on and not rote. But, times have changed. MOSS/WSS is a very wide area and getting deep hands on experience in all the departments is hard to come by. In my humble opinion, this is where certifications come in handy. It is a comitted exercise which makes you take a deep look into all nook and crannies of a complicated software. BTW, I passed the 4 exams - WSS/MOSS app dev &amp;amp;...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2008/12/04/wss-moss-certifications-i-did-it.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9175570" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>Dynamic loading of XAML in Silverlight- Interesting possibilities for Line of Business Applications</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2008/11/25/dynamic-loading-of-xaml-in-silverlight-interesting-possibilities-for-line-of-business-applications.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="113340" href="http://blogs.msdn.com/saurabhd/attachment/9139645.ashx" /><id>http://blogs.msdn.com/saurabhd/archive/2008/11/25/dynamic-loading-of-xaml-in-silverlight-interesting-possibilities-for-line-of-business-applications.aspx</id><published>2008-11-26T02:10:00Z</published><updated>2008-11-26T02:10:00Z</updated><content type="html">Introduction Large scale Line of Business Applications (such as ERP, CRM, Accounting) require extensive end user customization. This is a natural outcome of the fact that no two business are alike and customizations are inevitable. Consider an Human Resource module of an ERP system. There would be differences in data attributes required for an Employee record from one organization to another. The challenge lies in building a software framework that allows customization after the core product has...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2008/11/25/dynamic-loading-of-xaml-in-silverlight-interesting-possibilities-for-line-of-business-applications.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9139645" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>Hosting a Silverlight application on blogs.msdn.com</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2008/11/13/hosting-a-silverlight-application-on-blogs-msdn-com.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="4560" href="http://blogs.msdn.com/saurabhd/attachment/9053899.ashx" /><id>http://blogs.msdn.com/saurabhd/archive/2008/11/13/hosting-a-silverlight-application-on-blogs-msdn-com.aspx</id><published>2008-11-14T02:10:00Z</published><updated>2008-11-14T02:10:00Z</updated><content type="html">I did not find any ready documentation to host the Silverlight plugin on blog post on this site. So I set to out try this out my self. I spent an hour dabbling with editing the HTML code and trying to upload a XAP file into pictures library. All of that failed! Thankfully there is a much easier way to host a Silverlight 1.0/2.0 plugin. The steps are as follows: Install Windows Live Writer from here . Download the Silverlight plug-in from here . This plugin will allow you to embed a SL app in your...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2008/11/13/hosting-a-silverlight-application-on-blogs-msdn-com.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9053899" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>Composite Web Pages using Silverlight, Webparts and SharePoint</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2008/10/25/composite-pages-using-silverlight-webparts-and-sharepoint.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2008/10/25/composite-pages-using-silverlight-webparts-and-sharepoint.aspx</id><published>2008-10-25T03:03:00Z</published><updated>2008-10-25T03:03:00Z</updated><content type="html">I am an ardent admirer of Composite Application Block (CAB) and it's WPF avataar Prism . Those of you have worked with these technologies will agree with me that these blocks are a wonderful way to make customizable applicaitons composed out of modular UI applets. The desing of CAB &amp;amp; Prism framework allow for UI screens to be composed out of parts that were 'manufactured' in different development groups. The framework allows loosely coupled event based communication and data sharing to take placed...(&lt;a href="http://blogs.msdn.com/saurabhd/archive/2008/10/25/composite-pages-using-silverlight-webparts-and-sharepoint.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9015357" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author><category term="composite" scheme="http://blogs.msdn.com/saurabhd/archive/tags/composite/default.aspx" /><category term="prism" scheme="http://blogs.msdn.com/saurabhd/archive/tags/prism/default.aspx" /><category term="webpart" scheme="http://blogs.msdn.com/saurabhd/archive/tags/webpart/default.aspx" /><category term="sharepoint" scheme="http://blogs.msdn.com/saurabhd/archive/tags/sharepoint/default.aspx" /><category term="silverlight" scheme="http://blogs.msdn.com/saurabhd/archive/tags/silverlight/default.aspx" /></entry><entry><title>Long running operations using BackGroundWorker class</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2006/09/19/761036.aspx" /><link rel="enclosure" type="image/jpeg" length="10500" href="http://blogs.msdn.com/saurabhd/attachment/761036.ashx" /><id>http://blogs.msdn.com/saurabhd/archive/2006/09/19/761036.aspx</id><published>2006-09-18T21:11:00Z</published><updated>2006-09-18T21:11:00Z</updated><content type="html">&lt;DIV&gt;&lt;FONT face=Arial size=2&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;As a consultant, I encounter several customer queries with regards to application architecture. This was a query from a customer on how to handle long running operations in a windows forms 2.0 application. I recommended the class BackGroundWorker as one of the approaches. Here is a short and a really quick start with BackGroundWorker class built around the MSDN sample code snippet.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;STRONG&gt;Why do we&amp;nbsp;need to handle long running tasks in a special way?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;Consider a form which has a button. Clicking on the button should invoke a method in the Form class. As an example,assume that this method is named &lt;STRONG&gt;ComputeFibonacci&lt;/STRONG&gt;. In a non-asynchronous approach, the the windows forms would enter a suspended state the moment the button is clicked. This is because, the windows message loop which runs on a per thread basis is not able to process the queued up UI events like mouse move, click, etc. Thus, the application would become non-responsive and the user would have no way to even quit the applicatoin. The only way out for the end user, is to use the Task Manager to kill the process.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;STRONG&gt;How can a long running method be made to execute in a separate thread?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;Use the services of BackgroundWorker class.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial size=2&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;STRONG&gt;What is the BackgroundWorker class?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;This is a helper class allows you to run a time consuming process on a separate thread. It is the ability of running a long operation on a separate thread that makes BackgroundWorker class powerful.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;STRONG&gt;How should the BackgroundWorker class be initialized?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;OL dir=ltr&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;In a typical Win forms application, the form will have a member variable of type &lt;STRONG&gt;BackgroundWorker&lt;/STRONG&gt;. &lt;/FONT&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;As an example&amp;nbsp;assume that this instance is named &lt;STRONG&gt;backgroundWorker1&lt;/STRONG&gt;.&amp;nbsp;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;Create a event handler in the form class for the &lt;STRONG&gt;DoWork&lt;/STRONG&gt; event. Assume that this event handler is &lt;STRONG&gt;backgroundWorker1_DoWork&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;Invoke the method &lt;STRONG&gt;RunWorkerAsync&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;FONT color=#d3d3d3&gt;The object backgroundWorker1 will immediately invoke the delegate &lt;STRONG&gt;backgroundWorker1_DoWork&lt;/STRONG&gt;. Note- this invocation is on a thread that is&amp;nbsp;separate from that of the&amp;nbsp;main form. This can be verified by comparing the thread identifiers.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;LI&gt;
&lt;DIV&gt;&lt;FONT color=#d3d3d3&gt;In this method, kickstart the long operation, by making a simple method call to &lt;STRONG&gt;ComputeFibonacci&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;DIV dir=ltr&gt;&lt;STRONG&gt;&lt;FONT color=#d3d3d3&gt;Updating the UI progress in the midst of the ComputeFibonacci?&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT color=#d3d3d3&gt;Remember that calls to method ComputeFibonacci has occurrred on a separate thread. The controls of the parent window should not be accessed directly from within ComputeFibonacci. The method ComputerFibonacci may like to update the status bar as and when an iteration is complete. To achieve this the &lt;STRONG&gt;ReportProgress&lt;/STRONG&gt;&amp;nbsp;delegate of &lt;STRONG&gt;backgroundWorker1&lt;/STRONG&gt; should be invoked at appropriate times.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT color=#d3d3d3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT color=#d3d3d3&gt;The event handler for &lt;STRONG&gt;ProgressChangedEvent&lt;/STRONG&gt; which has been defined in the body of the main form will be invoked at regular interations in ComputeFibonacci and this invocation will occur in the same thread as that of the main Form.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT color=#d3d3d3&gt;&lt;STRONG&gt;How does the UI know when&amp;nbsp;the long running operation&amp;nbsp;is over&lt;/STRONG&gt;?&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;When the required number of interations is over in &lt;STRONG&gt;ComputeFibonacci&lt;/STRONG&gt;, the delegate &lt;STRONG&gt;RunWorkerCompleted&lt;/STRONG&gt; of the &lt;STRONG&gt;backgrounWorker1&lt;/STRONG&gt; object should be fired from within this method. The main form should handle the event RunWorkerCompleted appropriately and update the UI.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;STRONG&gt;How to terminate a long running operation?&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;Since, the UI is free to handle events, if the user clicks on the &lt;STRONG&gt;Cancel Async&lt;/STRONG&gt; button, the method &lt;STRONG&gt;CancelAsync&lt;/STRONG&gt; of the object bakcgroundWorker1 is invoked from the click handler. This kills the background thread that was doing the long running operation.&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT color=#d3d3d3&gt;&lt;STRONG&gt;Running the sample code&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;
&lt;DIV dir=ltr&gt;&lt;FONT face=Arial color=#d3d3d3 size=2&gt;The sample code comprises of a single C# Windows Application project. Extract the contents to a folder. Compile and run the app. Enter a number ( eg: 35) in the up-down control and click the button Start Async. Observe the progress bar. Enter a larger number (Eg: 50) and try to stop the long running operation by clicking on &lt;STRONG&gt;Cancel Async&lt;/STRONG&gt; button.&lt;/FONT&gt;&lt;/DIV&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=761036" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>Installing Enterprise Library 2.0 for .NET Framework January 2006 without Visual Studio 2005</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2006/09/14/753875.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2006/09/14/753875.aspx</id><published>2006-09-14T13:25:00Z</published><updated>2006-09-14T13:25:00Z</updated><content type="html">&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;I have the habit of having the online documentation of all the Microsoft products readily accessible. I was trying to install &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=5A14E870-406B-4F2A-B723-97BA84AE80B5&amp;amp;displaylang=en"&gt;Enterprise library 2.0 &lt;/A&gt;on my laptop to for the same purpose. I do not have VS.NET 2005 on my laptop. I use a Virtual PC disk to do my development activities. However, I wanted to have quick access to the Enterprise Library documentation on my laptop, without having to turn on my virtual machine. I realized the hard way that installing Enterprise Library without VS.NET 2005 does not bring up the documentation. However, I was lucky to find&amp;nbsp; a way out.&lt;/P&gt;
&lt;P&gt;This is what I did:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Ensure that MSDN for Visual Studio 2005 is installed. This will ensure that dexplore.exe is available.&lt;/LI&gt;
&lt;LI&gt;Install Enterprise Library 2.0&lt;/LI&gt;
&lt;LI&gt;The shortcut key for launching Enterprise Documentation will be available at:&lt;/LI&gt;
&lt;LI&gt;Start --&amp;gt; All Programs --&amp;gt; Microsoft Patterns &amp;amp; Practices --&amp;gt; Enterprise Library 2006 --&amp;gt; Enterprise Library Documentation.&lt;/LI&gt;
&lt;LI&gt;Clicking on this shortcut will open up dexplore.exe but it may not show you the Ent Lib documentation.&lt;/LI&gt;
&lt;LI&gt;Bring up the properties of the above mentioned Ent Lib documentation shortcut by using the context menu.&lt;/LI&gt;
&lt;LI&gt;Replace the contents of the text box "Target" with the following:&lt;/LI&gt;
&lt;LI&gt;"%CommonProgramFiles%\Microsoft Shared\Help 8\dexplore.exe" /helpcol ms-help://ms.EntLib.2006Jan&lt;/LI&gt;
&lt;LI&gt;(&lt;EM&gt;keep a copy of the original text just in case, you need to revert back&lt;/EM&gt;)&lt;/LI&gt;
&lt;LI&gt;Press Ok and try now. Dexplore.exe should be able to show the help collection of&amp;nbsp;enterprise library.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Hope this helps!&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=753875" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>Invoking SqlMembershipProvider from a Windows forms application</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2006/08/02/685552.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2006/08/02/685552.aspx</id><published>2006-08-01T21:41:00Z</published><updated>2006-08-01T21:41:00Z</updated><content type="html">&lt;P&gt;&amp;nbsp;The abstraction&amp;nbsp;provided by MembershipProvider base class is a very powerful concept in ASP.NET 2.0. It simplifies the management of user information by providing a neat layer. &lt;/P&gt;
&lt;P&gt;ASP.NET 2.0 provides the SqlMembershipProvider class and the aspnet_regsql command line utility to create the database user management database. My customer was building a hybrid application, which was mainly ASP.NET 2.0, but there were a few forms implemented using Windows forms. The question&amp;nbsp; arose as to how a windows forms login form can be created that will use the &lt;STRONG&gt;SqlMembershipProvider&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;This is what I did.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Created a new windows forms application. Add an app.config file. 
&lt;LI&gt;Added the following section to the config file. 
&lt;LI&gt;Ensure that the settings match with your database (which would have been created using &lt;STRONG&gt;aspnet_regsql.exe&lt;/STRONG&gt; tool)&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT color=#a9a9a9&gt;&amp;nbsp; &amp;lt;configSections&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;section name="connectionStrings" type="System.Configuration.ConnectionStringsSection, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" requirePermission="false" /&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;lt;/configSections&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#a9a9a9&gt;&amp;nbsp; &amp;lt;connectionStrings&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="mydb" connectionString ="Data Source=localhost;Integrated Security=SSPI;Initial Catalog=Helloworld;"/&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp; &amp;lt;/connectionStrings&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Wrote a factory method to instantiate and correctly initialize the provider. ASP.NET 2.0 reuses a single instance of the provider for servicing all requests. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT color=#a9a9a9&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class MembershipProviderFactory&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#a9a9a9&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static public MembershipProvider Create()&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string cn="";&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Configuration.Configuration config=&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (config == null ) throw new ConfigurationErrorsException ("Could not read config file");&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#a9a9a9&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //searching for the connection string element with the zero th index.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConnectionStringsSection cnstringssection;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnstringssection = config.ConnectionStrings;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (cnstringssection.ConnectionStrings.Count == 0) throw new ConfigurationErrorsException("connection string information not found in config file");&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#a9a9a9&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConnectionStringSettings cnsettings;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnsettings = cnstringssection.ConnectionStrings[0];&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cn = cnsettings.ConnectionString;&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (string.IsNullOrEmpty (cn))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new ConfigurationErrorsException("connection string information (cn) not found in config file");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#a9a9a9&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SqlMembershipProvider prov = new SqlMembershipProvider();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NameValueCollection vals=new NameValueCollection ();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vals.Add("name", "sql");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vals.Add("connectionStringName", "mydb");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vals.Add("applicationName", "MyApplication");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vals.Add("maxInvalidPasswordAttempts", "100");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; prov.Initialize("sql", vals);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (MembershipProvider)prov;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;BR&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The &lt;STRONG&gt;applicationName&lt;/STRONG&gt; property should match the web.config settings in the ASP.NET application. 
&lt;LI&gt;The code for validating the user credentials is as follows&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT color=#a9a9a9&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Web.Security.MembershipProvider&amp;nbsp;&amp;nbsp;&amp;nbsp; memprov;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memprov = MembershipProviderFactory.Create();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (memprov.ValidateUser("user1", "pass@word1") == false )&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("Invalid username or password"); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MessageBox.Show("User credentials verified");&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;..The important thing to be remembered here is that SqlMembershipProvider expects the &lt;STRONG&gt;&amp;lt;connectionStrings&amp;gt;&lt;/STRONG&gt; section in the configuratin file for connecting to Sql server. I would be very glad if somebody can find out how SqlMembershipProvider can be initialized without the need for &lt;STRONG&gt;&amp;lt;connectionStrings&amp;gt;&lt;/STRONG&gt; section in the app.config file.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I do believe that this is not the best way to solve my customer's problem. A better way would be to expose web services&amp;nbsp;for the required functionality&amp;nbsp;and let the windows forms app connect to this service using WSe 3.0/WCF and passing the user name token along with the method invocation. This would be more secure because the connection string is not exposed to the caller&amp;nbsp;and it would be n-tiered as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=685552" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry><entry><title>My first blog entry</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/saurabhd/archive/2006/07/30/682706.aspx" /><id>http://blogs.msdn.com/saurabhd/archive/2006/07/30/682706.aspx</id><published>2006-07-29T21:35:00Z</published><updated>2006-07-29T21:35:00Z</updated><content type="html">&lt;P&gt;&lt;EM&gt;I am excited!&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=682706" width="1" height="1"&gt;</content><author><name>saurabhd</name><uri>http://blogs.msdn.com/members/saurabhd.aspx</uri></author></entry></feed>