<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Vinay</title>
  <link>http://vindee.livejournal.com/</link>
  <description>Vinay - LiveJournal.com</description>
  <lastBuildDate>Mon, 28 Jan 2008 08:01:22 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>vindee</lj:journal>
  <lj:journalid>13297019</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/10392.html</guid>
  <pubDate>Mon, 28 Jan 2008 08:01:22 GMT</pubDate>
  <title>My Daemon</title>
  <link>http://vindee.livejournal.com/10392.html</link>
  <description>&lt;lj-embed id=&quot;5&quot; /&gt;</description>
  <comments>http://vindee.livejournal.com/10392.html</comments>
  <category>gen</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/10182.html</guid>
  <pubDate>Fri, 07 Dec 2007 09:57:32 GMT</pubDate>
  <title>Create a setup project for a Windows Service in C#</title>
  <link>http://vindee.livejournal.com/10182.html</link>
  <description>This article describes how to create a setup project for a Windows Service application (formerly named an &quot;NT service&quot;). To do this, you must first create a solution that contains a simple Windows Service project that writes an entry to its application log. You then add a setup project to the solution to install the Window Service. Finally, you start the service from Microsoft Visual Studio .NET or Microsoft Visual Studio 2005 Server Explorer.&lt;br /&gt;&lt;br /&gt;Requirements &lt;br /&gt;The following list outlines the recommended hardware, software, network infrastructure, and service packs that you must have: &lt;br /&gt;&lt;br /&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Microsoft Windows 2000 Professional, Microsoft Windows Server 2003, Microsoft Windows 2000 Server, Microsoft Windows XP Professional, or Microsoft Windows XP Server with Microsoft .NET Framework installed&lt;br /&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Microsoft Visual Studio .NET Enterprise, Microsoft Visual Studio .NET Enterprise Architect, or Microsoft Visual Studio 2005&lt;br /&gt;&lt;br /&gt;This article assumes that the user account that you use to install and to run this service has the permissions that you must have to install and to start services, and also has the permissions that you must have to access the event log.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Create a Setup Project for a Windows Service&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This section describes how to create a Windows Service project, and how to use a compiled setup project to install the Windows Service.&lt;br /&gt;&lt;br /&gt;Create a Windows Service Project&lt;br /&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Start Microsoft Visual Studio .NET or Microsoft Visual Studio 2005.&lt;br /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp; On the File menu, point to New, and then click Project. &lt;br /&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp; Click Visual C# Projects under Project Types, and then click Windows Service under Templates. &lt;br /&gt;Note In Visual Studio 2005, expand Visual C# under Project Types, click Windows, and then click Windows Service under Templates. &lt;br /&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp; Type LogWriterService in the Name text box, and then type C:\ in the Location text box. Click OK.&lt;br /&gt;5.&amp;nbsp;&amp;nbsp;&amp;nbsp; In Solution Explorer, right-click Service1.cs, and then click View Code.&lt;br /&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp; In the OnStart event handler, replace the comments with the following code:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;font color=&quot;#000000&quot;&gt;&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;EventLog.WriteEntry(&quot;My simple service started.&quot;);&lt;/font&gt;&lt;br /&gt;7.&amp;nbsp;&amp;nbsp;&amp;nbsp; In Solution Explorer, double-click Service1.cs. &lt;br /&gt;8.&amp;nbsp;&amp;nbsp;&amp;nbsp; In the Code Editor window, right-click Design View, and then click Properties&lt;br /&gt;9.&amp;nbsp;&amp;nbsp;&amp;nbsp; In the Properties pane, click the Add Installer link. &lt;br /&gt;10.&amp;nbsp;&amp;nbsp;&amp;nbsp; In the Properties pane for ServiceInstaller1, change the ServiceName property to Service1.&lt;br /&gt;11.&amp;nbsp;&amp;nbsp;&amp;nbsp; In the Code Editor window in Design view, click ServiceProcessInstaller1. &lt;br /&gt;12.&amp;nbsp;&amp;nbsp;&amp;nbsp; In the Properties pane, change the Account property to LocalSystem (The LocalService and NetworkService values are available only in Microsoft Windows XP).&lt;br /&gt;&lt;br /&gt;Use a Compiled Setup Project to Install the Windows Service&lt;br /&gt;&lt;br /&gt;After you complete the steps in the previous section to configure the Windows Service project, follow these steps to add a deployment project that packages the service application so that the service application can be installed: &lt;br /&gt;&lt;br /&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Add a new project to your LogWriterService project. To do this, follow these steps: &lt;br /&gt;a. &amp;nbsp;&amp;nbsp;&amp;nbsp; In Solution Explorer, right-click Solution &apos;LogWriterService&apos; (1 project), point to Add, and then click New Project. &lt;br /&gt;b. &amp;nbsp;&amp;nbsp;&amp;nbsp; Click Setup and Deployment Projects under Project Types, and then click Setup Project under Templates. &lt;br /&gt;c. &amp;nbsp;&amp;nbsp;&amp;nbsp; In the Name text box, type ServiceSetup. &lt;br /&gt;d. &amp;nbsp;&amp;nbsp;&amp;nbsp; Type C:\ in the Location text box, and then click OK. &lt;br /&gt;&lt;br /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp; Tell the deployment project what to package. To do this, follow these steps: &lt;br /&gt;a. &amp;nbsp;&amp;nbsp;&amp;nbsp; In Solution Explorer, right-click ServiceSetup, point to Add, and then click Project Output&lt;br /&gt;b. &amp;nbsp;&amp;nbsp;&amp;nbsp; In the Add Project Output Group dialog box, in the Project box, click LogWriterService&lt;br /&gt;c. &amp;nbsp;&amp;nbsp;&amp;nbsp; Click Primary Output, and then click OK.&lt;br /&gt;&lt;br /&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp; For correct installation, add only primary output. To add the custom actions, follow these steps: &lt;br /&gt;a. &amp;nbsp;&amp;nbsp;&amp;nbsp; In Solution Explorer, right-click ServiceSetup, point to View, and then click Custom Actions&lt;br /&gt;b. &amp;nbsp;&amp;nbsp;&amp;nbsp; Right-click Custom Actions, and then click Add Custom Action. &lt;br /&gt;c. &amp;nbsp;&amp;nbsp;&amp;nbsp; Click Application Folder, and then click OK. &lt;br /&gt;d. &amp;nbsp;&amp;nbsp;&amp;nbsp; Click Primary output from LogWriterService (Active), and then click OK. &lt;br /&gt;Notice that Primary output appears under Install, Commit, Rollback and Uninstall. &lt;br /&gt;&lt;br /&gt;4.&amp;nbsp;&amp;nbsp;&amp;nbsp; By default, setup projects are not included in the build configuration. To build the solution, use one of the following methods: &lt;br /&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Method 1&lt;br /&gt;a. &amp;nbsp;&amp;nbsp;&amp;nbsp; Right-click LogWriterService, and then click Build. &lt;br /&gt;b. &amp;nbsp;&amp;nbsp;&amp;nbsp; Right-click ServiceSetup, and then click Build. &lt;br /&gt;&lt;br /&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Method 2&lt;br /&gt;a. &amp;nbsp;&amp;nbsp;&amp;nbsp; On the Build menu, click Configuration Manager to build the whole solution.&lt;br /&gt;b. &amp;nbsp;&amp;nbsp;&amp;nbsp; Click to select the Build check box for ServiceSetup. &lt;br /&gt;c. &amp;nbsp;&amp;nbsp;&amp;nbsp; Press F7 to build the whole solution. When the solution is built, you have a complete installation package that is available for the service.&lt;br /&gt;&lt;br /&gt;5.&amp;nbsp;&amp;nbsp;&amp;nbsp; To install the newly built service, right-click ServiceSetup, and then click Install. &lt;br /&gt;6.&amp;nbsp;&amp;nbsp;&amp;nbsp; In the ServiceSetup dialog box, click Next three times. Notice that a progress bar appears while the service installs. &lt;br /&gt;7.&amp;nbsp;&amp;nbsp;&amp;nbsp; When the service is installed, click Close. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Complete Code Listing&lt;/b&gt;&lt;br /&gt;Service1.cs&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Collections;&lt;br /&gt;using System.ComponentModel;&lt;br /&gt;using System.Data;&lt;br /&gt;using System.Diagnostics;&lt;br /&gt;using System.ServiceProcess;&lt;br /&gt;namespace LogWriterService&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Service1 : System.ServiceProcess.ServiceBase&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt; &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; /// Required designer variable.&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;lt;/summary&amp;gt;&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; private System.ComponentModel.Container components = null; &lt;br /&gt;&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; public Service1()&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The Windows.Forms Component Designer must have this call.&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO: Add any initialization after the InitComponent call&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; }&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The main entry point for the process&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; static void Main()&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.ServiceProcess.ServiceBase[] ServicesToRun;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // More than one user service may run in the same process. To add&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // another service to this process, change the following line to&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create a second service object. For example,&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp; ServicesToRun = New System.ServiceProcess.ServiceBase[] {new Service1(), new MySecondUserService()};&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service1() };&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.ServiceProcess.ServiceBase.Run(ServicesToRun);&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; }&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt; &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; /// Required method for Designer support - do not modify &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; /// the contents of this method with the code editor.&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;lt;/summary&amp;gt;&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; private void InitializeComponent()&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; components = new System.ComponentModel.Container();&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.ServiceName = &quot;Service1&quot;;&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; }&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;&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; /// Clean up any resources that are being used.&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;lt;/summary&amp;gt;&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; protected override void Dispose( bool disposing )&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if( disposing )&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;&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;&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; if (components != null) &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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; components.Dispose();&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; base.Dispose( disposing );&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; }&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;&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; /// Set things in motion so your service can do its work.&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;lt;/summary&amp;gt;&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; protected override void OnStart(string[] args)&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventLog.WriteEntry(&quot;My simple service started.&quot;);&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; }&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// &amp;lt;summary&amp;gt;&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; /// Stop this service.&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;lt;/summary&amp;gt;&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; protected override void OnStop()&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; {&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO: Add code here to perform any tear-down necessary to stop your service.&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; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Verify That It Works&lt;br /&gt;&lt;br /&gt;1.&amp;nbsp;&amp;nbsp;&amp;nbsp; In Control Panel, double-click Administrative Tools, and then double-click Services&lt;br /&gt;2.&amp;nbsp;&amp;nbsp;&amp;nbsp; Right-click Service1, and then click Start&lt;br /&gt;3.&amp;nbsp;&amp;nbsp;&amp;nbsp; Use one of the following methods to verify that an event is logged in the event log: &lt;br /&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Method 1&lt;br /&gt;a. &amp;nbsp;&amp;nbsp;&amp;nbsp; In Control Panel, double-click Administrative Tools, and then double-click Event Viewer.&lt;br /&gt;b. &amp;nbsp;&amp;nbsp;&amp;nbsp; Click Application Log in the left pane, and then locate the event log for your service from the right pane. &lt;br /&gt;&lt;br /&gt;•&amp;nbsp;&amp;nbsp;&amp;nbsp; Method 2&lt;br /&gt;a. &amp;nbsp;&amp;nbsp;&amp;nbsp; In Server Explorer, expand Servers, expand ComputerName, expand Event Logs, expand Application, and then expand Service1. Recall that Service1 is the name of the class, not the service itself. Therefore, Service1 is used as the application name. (It is beyond the scope of this article to explain how to customize the names.)&lt;br /&gt;b. &amp;nbsp;&amp;nbsp;&amp;nbsp; Move the cursor over the log entries. The second entry from the top should read &quot;My simple service started&quot;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;</description>
  <comments>http://vindee.livejournal.com/10182.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/9731.html</guid>
  <pubDate>Fri, 07 Dec 2007 06:19:57 GMT</pubDate>
  <title>Avoid losing Session data when Deleting Directories!!!!</title>
  <link>http://vindee.livejournal.com/9731.html</link>
  <description>Add the following code in Application_Start() in you Global.asax file. &lt;br /&gt;&lt;br /&gt;&lt;p&gt;//FIX disable AppDomain restart when deleting subdirectory &lt;/p&gt; &lt;p&gt;//This code will turn off monitoring from the root website directory. &lt;/p&gt; &lt;p&gt;//Monitoring of Bin, App_Themes and other folders will still be operational, so updated DLLs will still auto deploy.&lt;/p&gt; &lt;p&gt;System.Reflection.PropertyInfo p = typeof(System.Web.HttpRuntime).GetProperty(&quot;FileChangesMonitor&quot;, System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); &lt;/p&gt; &lt;p&gt;object o = p.GetValue(null, null);&lt;/p&gt; &lt;p&gt;System.Reflection.FieldInfo f = o.GetType().GetField(&quot;_dirMonSubdirs&quot;, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.IgnoreCase); &lt;/p&gt; &lt;p&gt;object monitor = f.GetValue(o);&lt;/p&gt; &lt;p&gt;System.Reflection.MethodInfo m = monitor.GetType().GetMethod(&quot;StopMonitoring&quot;, System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic); m.Invoke(monitor, new object[] { }); &lt;/p&gt;</description>
  <comments>http://vindee.livejournal.com/9731.html</comments>
  <category>code</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/9636.html</guid>
  <pubDate>Fri, 07 Dec 2007 03:47:47 GMT</pubDate>
  <title>Linq to Sql Surprise Performance Hit</title>
  <link>http://vindee.livejournal.com/9636.html</link>
  <description>Here is a &lt;a href=&quot;http://jdconley.com/blog/archive/2007/11/28/linq-to-sql-surprise-performance-hit.aspx&quot;&gt;link&lt;/a&gt; that discusses the performance issues associated with using LINQ to SQL. Its shows how to use compiled queries rather than normal ones to boost performance.</description>
  <comments>http://vindee.livejournal.com/9636.html</comments>
  <category>code</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/9372.html</guid>
  <pubDate>Tue, 13 Nov 2007 08:45:00 GMT</pubDate>
  <title>Some Links</title>
  <link>http://vindee.livejournal.com/9372.html</link>
  <description>&lt;h2&gt;&lt;a href=&quot;http://tiredblogger.wordpress.com/2007/10/15/creating-a-vista-like-menu-bar-custom-control/&quot; rel=&quot;bookmark&quot; title=&quot;Read Creating a Vista-like Menu Bar Custom Control&quot;&gt;Creating a Vista-like Menu Bar Custom&amp;nbsp;Control&lt;/a&gt;&lt;/h2&gt;&lt;h2&gt;&lt;a href=&quot;http://tiredblogger.wordhttp://tiredblogger.wordpress.com/2007/10/24/basic-tutorial-on-ivkm-and-java-in-net/&quot; rel=&quot;bookmark&quot; title=&quot;Read Basic tutorial on IVKM and Java in .NET&quot;&gt;Basic tutorial on IKVM and Java in&amp;nbsp;.NET&lt;/a&gt;&lt;/h2&gt;</description>
  <comments>http://vindee.livejournal.com/9372.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/8992.html</guid>
  <pubDate>Fri, 19 Oct 2007 11:54:18 GMT</pubDate>
  <title>LIMIT in SQL</title>
  <link>http://vindee.livejournal.com/8992.html</link>
  <description>This query gives you the same ability as a LIMIT clause does in MySQL for MS SQL Server.&lt;br /&gt;&lt;br /&gt;SELECT * FROM employee LIMIT 10,10&amp;nbsp; (-- MySQL --)&lt;br /&gt;will give 10 records from 11 upto 20&lt;br /&gt;&lt;br /&gt;In SQL you can achieve the same result by running the following query&lt;br /&gt;&lt;br /&gt;select * from (&lt;br /&gt;&amp;nbsp;select top 10 * from (&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select top 20 *&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from TABLE&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;b&gt;order by name asc&lt;/b&gt;&lt;br /&gt;&amp;nbsp;) as newtbl &lt;b&gt;order by name desc&lt;/b&gt;&lt;br /&gt;) as newtbl2 &lt;b&gt;order by name asc&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this example - 20, since you start at 10 and want 10 rows (10+10=20).</description>
  <comments>http://vindee.livejournal.com/8992.html</comments>
  <category>gen</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/8955.html</guid>
  <pubDate>Thu, 18 Oct 2007 05:12:23 GMT</pubDate>
  <title>Retrieving HTTP content in .NET</title>
  <link>http://vindee.livejournal.com/8955.html</link>
  <description>Here is a good article to use the WebRequest and WebResponse object from .NET&lt;br /&gt;&lt;br /&gt;Link : &lt;a href=&quot;http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm&quot;&gt;Retrieving HTTP content in .NET&lt;/a&gt;</description>
  <comments>http://vindee.livejournal.com/8955.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/8520.html</guid>
  <pubDate>Thu, 18 Oct 2007 05:04:19 GMT</pubDate>
  <title>Remove duplicate values from an arraylist</title>
  <link>http://vindee.livejournal.com/8520.html</link>
  <description>I had a situation where in i had to remove duplicate values from an arraylist. I was trying a few thing with this and came up with this code which according to me if quite efficient.&lt;br /&gt;&lt;br /&gt;public static ArrayList RemoveDuplicates(ArrayList list) &lt;br /&gt;{&lt;br /&gt;ArrayList ret=new ArrayList();&lt;br /&gt;foreach (object obj in list) {&lt;br /&gt;if (!ret.Contains(obj)) ret.Add(obj);&lt;br /&gt;}&lt;br /&gt;return ret;&lt;br /&gt;}</description>
  <comments>http://vindee.livejournal.com/8520.html</comments>
  <category>code</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/8295.html</guid>
  <pubDate>Tue, 16 Oct 2007 06:58:20 GMT</pubDate>
  <title>Open Source projects in ASP.NET</title>
  <link>http://vindee.livejournal.com/8295.html</link>
  <description>You can get some good open source projects from &quot;Community Projects&quot; from the ASP.NET website.&lt;br /&gt;&lt;br /&gt;Link : &lt;a href=&quot;http://www.asp.net/Default.aspx?tabindex=6&amp;amp;tabid=50&quot;&gt;Community Projects&lt;/a&gt;</description>
  <comments>http://vindee.livejournal.com/8295.html</comments>
  <category>code</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/7983.html</guid>
  <pubDate>Tue, 16 Oct 2007 06:56:44 GMT</pubDate>
  <title>Optional Parameters in C#</title>
  <link>http://vindee.livejournal.com/7983.html</link>
  <description>I have seen Optional parameters being used in VB.net, but there is no provision to do the same in C#. We can achieve this functionality by using the Params keyword.&lt;br /&gt;Params allows you to send any number of parameters to a function. But we have to be careful while using this because anything that follow s the Params keyword is taken as an argument, so we have to use the Params keyword as the last item.&lt;br /&gt;We can achieve the optional feature by not sending any value to the Params.&lt;br /&gt;&lt;br /&gt;EG:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrintName(&quot;ASP.NET&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void PrintName(params string[] values)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (values.Length &amp;gt; 0)&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; Response.Write(values[0]);&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; else&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; Response.Write(&quot;Empty&quot;);&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; }</description>
  <comments>http://vindee.livejournal.com/7983.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/7877.html</guid>
  <pubDate>Mon, 15 Oct 2007 08:57:21 GMT</pubDate>
  <title>Close browser window without confirmation using JS</title>
  <link>http://vindee.livejournal.com/7877.html</link>
  <description>&lt;br /&gt;To close a browser window without the confirmation dialog,&lt;span&gt; just put&amp;nbsp; &lt;b&gt;window.opener=self; &lt;/b&gt;before the &lt;b&gt;window.close();&lt;/b&gt; &lt;/span&gt;</description>
  <comments>http://vindee.livejournal.com/7877.html</comments>
  <category>gen</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/7639.html</guid>
  <pubDate>Mon, 15 Oct 2007 06:59:17 GMT</pubDate>
  <title>Display Please Wait While the Page Refreshes</title>
  <link>http://vindee.livejournal.com/7639.html</link>
  <description>This can easily be achieved by using the ClientScript.GetPostBackEventReference method.&lt;br /&gt;&lt;br /&gt;this.Btn_Upload.Attributes.Add(&quot;onclick&quot;, &quot;this.value=&apos;Please wait..&apos;; this.disabled=true;&quot; + ClientScript.GetPostBackEventReference(this.Btn_Upload,&quot;&quot;));&lt;br /&gt;&lt;br /&gt;The GetPostBackEventReference injects the __doPostBack method and also the hidden fields that hold the event target and event arguments.&lt;br /&gt;&lt;br /&gt;This is a useful technique when uploading large files and during the process disabling the button control.&amp;nbsp;</description>
  <comments>http://vindee.livejournal.com/7639.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/7188.html</guid>
  <pubDate>Fri, 12 Oct 2007 04:04:30 GMT</pubDate>
  <title>&quot;I&quot;</title>
  <link>http://vindee.livejournal.com/7188.html</link>
  <description>The evening sun was gorgeous, I watched the splendidly perfect golden sphere slowly descending on the western horizon, behind the translucent patches of clouds.&lt;br /&gt;&lt;br /&gt;Exactly at the same time, on the eastern horizon the glorious moon ascended, not in the crescent, but in full size and splendor. It changed its size and color as it ascended, appearing smaller with a silvery white gloss on the clear blue sky.&lt;br /&gt;&lt;br /&gt;Why dose the moon appear running faster as it rises ans then slowing down? Maybe an illusion, just as it seems to go faster under the clouds. And why does it look so big first and then small, why change its color? What kind of illusion is this? Optical illusion? Color illusion? But the moon was so beautiful, cool and peaceful.&lt;br /&gt;&lt;br /&gt;One can keep looking at it for hours and keep wondering about the world, the stars, the cosmos and ones own self. The &apos;I&apos; is so small, so insignificant, one in a million, one individual in several billion humans on earth, a dust particle in this vast earth. And compare this earth with the size of sun, with all the suns, stars and galaxies, distant stars, millions and billions of light years away and million times bigger and brighter than our own sun. Its beyond imagination. And this &apos;I&apos; is infinitesimal, really nothing. Yet, it asserts &apos;I&apos;, wants name, fame, wealth, power, to impress and to subjugate a handful of fellow humans for a few years, a fraction of his life span. Then this of his life span, hundred years? a trifle, compared to the age of these rocks, earth and of the universe, not even a droplet in the limitless ocean of time.&lt;br /&gt;&lt;br /&gt;Text taken from the book &quot;Scientists search for truth&quot;</description>
  <comments>http://vindee.livejournal.com/7188.html</comments>
  <category>gen</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/6997.html</guid>
  <pubDate>Thu, 11 Oct 2007 14:01:04 GMT</pubDate>
  <title>Reading and Writing Excel Spreadsheets Using ADO.NET C# DbProviderFactory</title>
  <link>http://vindee.livejournal.com/6997.html</link>
  <description>&lt;p&gt;After reading David Hayden`s&amp;nbsp;blog today I found a very interesting tutorial on reading and writing Excel Spreadsheets and Worksheets using &lt;a href=&quot;http://davidhayden.com/blog/dave/archive/2006/05/26/2973.aspx&quot;&gt;C# and ADO.NET&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Apparently you can insert, update, and delete data from an Excel spreadsheet as if it were a database using OleDbManaged Data Provider and C#.&lt;/p&gt;</description>
  <comments>http://vindee.livejournal.com/6997.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/6863.html</guid>
  <pubDate>Thu, 11 Oct 2007 13:42:31 GMT</pubDate>
  <title>Use System.Reflection For Comparing Custom Objects</title>
  <link>http://vindee.livejournal.com/6863.html</link>
  <description>&lt;a href=&quot;http://www.bigbold.com/snippets/&quot;&gt;&lt;br /&gt;&lt;/a&gt;Account first = new Account(&quot;email&quot;, &quot;007&quot;, &quot;name&quot;);&lt;br /&gt;Account second = new Account(&quot;email&quot;, &quot;000007&quot;, &quot;name&quot;);&lt;br /&gt;&lt;br /&gt;For strings, integers, DateTime&apos;s, etc... using object.Equals works just fine for comparing two objects.&amp;nbsp; I can&apos;t tell you how many times I have seen someone do the following to compare two custom objects (such as the Account objects above).&lt;br /&gt;&lt;br /&gt;public static bool IsEqualTo(Account one, Account two)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; bool isEqual = true;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; if (!one.EmailAddress.Equals(two.EmailAddress))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isEqual = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp; else if (!one.Password.Equals(two.Password))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isEqual = false;&lt;br /&gt;&amp;nbsp;&amp;nbsp; else if (!one.Username.Equals(two.Username))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; isEqual = false;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; return isEqual;&lt;br /&gt;} &lt;br /&gt;&lt;br /&gt;There is a much more graceful way. Enter System.Reflection. &lt;br /&gt;&lt;br /&gt;public static bool IsEqualTo(object one, object two)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; bool isEqual = true;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; foreach (PropertyInfo p in one.GetType().GetProperties())&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!p.GetValue(one, null).Equals(p.GetValue(two, null)))&lt;br /&gt;&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; isEqual = false;&lt;br /&gt;&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; break;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; return isEqual;&lt;br /&gt;}&amp;nbsp;&amp;nbsp;</description>
  <comments>http://vindee.livejournal.com/6863.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/6401.html</guid>
  <pubDate>Thu, 11 Oct 2007 10:46:35 GMT</pubDate>
  <title>Code Snippets - Public domain source code repository</title>
  <link>http://vindee.livejournal.com/6401.html</link>
  <description>&lt;b&gt;Snippets is a public source code repository.&lt;/b&gt; Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world&lt;br /&gt;&lt;br /&gt;Here is the link :&lt;br /&gt;&lt;a href=&quot;http://www.bigbold.com/snippets/&quot;&gt;Code Snippets: Store, sort and share source code, with tag goodness&lt;/a&gt;</description>
  <comments>http://vindee.livejournal.com/6401.html</comments>
  <category>code</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/6204.html</guid>
  <pubDate>Thu, 11 Oct 2007 10:17:00 GMT</pubDate>
  <title>Merging Different DataSources</title>
  <link>http://vindee.livejournal.com/6204.html</link>
  <description>Database dbSandbox = DatabaseFactory.CreateDatabase(“Sandbox”);&lt;br /&gt;&lt;br /&gt;string sqlSandbox = “SELECT COUNT(r.RecordId) as Count, r.DepartmentId “ +&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; “FROM ExceptionRecords r “ +&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;&amp;nbsp;&amp;nbsp; “WHERE Year = @Year “ +&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;&amp;nbsp;&amp;nbsp; “GROUP BY r.DepartmentId “ +&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;&amp;nbsp;&amp;nbsp; “ORDER BY r.DepartmentId”;&lt;br /&gt;&lt;br /&gt;DbCommand cmdSandbox = dbSandbox.GetSqlStringCommand(sqlSandbox);&lt;br /&gt;db.AddInParameter(cmdSandbox, “Year”, DbType.Int32, 2006);&lt;br /&gt;&lt;br /&gt;DataTable dtSandbox = dbSandbox.ExecuteDataSet(cmd).Tables[0];&lt;br /&gt;&lt;br /&gt;Now we have a DataTable object that contains our information.&amp;nbsp; However, while we have the DepartmentId, we need the Department Name for our report.&amp;nbsp; That information is not located anywhere within the SQL Server database because the application is using our standard framework to get that information at runtime.&lt;br /&gt;&lt;br /&gt;So, let’s add a new string column to our DataTable to hold the Department name.&lt;br /&gt;&lt;br /&gt;dtSandbox.Columns.Add(new DataColumn(“DepartmentName”, typeof (string)));&lt;br /&gt;&lt;br /&gt;Now, we’re ready to loop through and populate that new column.&lt;br /&gt;&lt;br /&gt;foreach (DataRow row in dtSandbox.Rows)&lt;br /&gt;{&lt;br /&gt;row[“DepartmentName”] = Depts.GetDept(Convert.ToInt32(row[“DepartmentId”])).Name;&lt;br /&gt;}</description>
  <comments>http://vindee.livejournal.com/6204.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/5951.html</guid>
  <pubDate>Thu, 11 Oct 2007 10:10:43 GMT</pubDate>
  <title>Creating a Scrollable GridView Custom Control</title>
  <link>http://vindee.livejournal.com/5951.html</link>
  <description>A custom gridview control to create a scrollable gridview in asp.net 2.0. You can find the post &lt;a href=&quot;http://tiredblogger.wordpress.com/2007/09/21/creating-an-excel-scrolling-gridview-custom-control/&quot;&gt;here&lt;/a&gt;</description>
  <comments>http://vindee.livejournal.com/5951.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/5672.html</guid>
  <pubDate>Thu, 11 Oct 2007 10:05:21 GMT</pubDate>
  <title> Tips for Nested Master Pages and VS 2005 Design-Time</title>
  <link>http://vindee.livejournal.com/5672.html</link>
  <description>One of the cool advanced features of the new Master Pages feature in ASP.NET 2.0 is the ability to nest them.&amp;nbsp; For example, you could define a top-level master-page called “MainMaster.master” that defines a common logo header and footer, and defines a content-placeholder for the page called “content”.&amp;nbsp; You could then define two sub-masters beneath it – one that provides a two-column layout model for the content (“TwoColumnMaster.master”), and one that provides a three-column layout model (“ThreeColumnMaster.master”).&amp;nbsp; These two nested-master pages could then use the MainMaster.master file as the root master, and only adjust the layout within its content section (each would fill in the &quot;content&quot; placeholder and in turn add their own content-placeholders for sub-pages within it).&amp;nbsp; The benefit of this approach is that if a designer ever changed the logo or top-level design of the site, they only have to update one file (MainMaster.master) and then have every page on the site automatically pick it up regardless of what master file they were based on.&lt;br /&gt;&lt;br /&gt;This nested model is pretty cool and powerful, and allows arbitrary levels of nesting.&amp;nbsp; The only downside is that VS 2005 only supports nested master page editing in source-view, and doesn’t support it in the WYWSIWYG designer (note: obviously it does support editing them when the master-pages are not nested). &lt;br /&gt;&lt;br /&gt;There is a cool tip/trick, though, that will allow you to load a design-surface for a page that uses nested master-pages.&amp;nbsp; This will allow you to use all of the control-designers and smart-tasks in design-view for the page (for example: to perform data-binding, auto-format things, and use any of the control wizards), and not have to change any-code to test it at runtime.&lt;br /&gt;&lt;br /&gt;The tip/trick works by adding a base-page class to your project or solution that defines a new property called “RuntimeMasterPageFile” of type string.&amp;nbsp; The base-class then overrides the page’s “OnPreInit” method and uses this property to set the Page object’s MasterPageFile at runtime:&lt;br /&gt;&lt;br /&gt;public class BasePage : System.Web.UI.Page &lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; private string runtimeMasterPageFile;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string RuntimeMasterPageFile &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get &lt;br /&gt;&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; return runtimeMasterPageFile;&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; set &lt;br /&gt;&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; runtimeMasterPageFile = value;&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; }&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void OnPreInit(EventArgs e) &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (runtimeMasterPageFile != null) &lt;br /&gt;&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; this.MasterPageFile = runtimeMasterPageFile;&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; base.OnPreInit(e);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Once a code-behind class derives from this base class, it becomes possible for a developer to set this “RuntimeMasterPageFile” property in the .aspx file’s &amp;lt;%@ Page %&amp;gt; directive (note: the CodeFileBaseClass also needs to be set to the base class to enable this):&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page Language=&quot;C#&quot;&lt;br /&gt;MasterPageFile=&quot;~/Test.master&quot; RuntimeMasterPageFile=&quot;SubMaster.master&quot; CodeFileBaseClass=&quot;BasePage&quot;&lt;br /&gt;AutoEventWireup=&quot;true&quot;&lt;br /&gt;CodeFile=&quot;Default.aspx.cs&quot;&lt;br /&gt;Inherits=&quot;_Default&quot;&lt;br /&gt;Title=&quot;My Page Title&quot; %&amp;gt;&lt;br /&gt;&lt;br /&gt;You’ll notice that the above page now has two master-page file directives – the usual “MasterPageFile” directive that VS will use at design-time, and then the custom RuntimeMasterPageFile directive that will override this at runtime.&amp;nbsp; What this allows you to do is point the page at a “test.master” file at design-time that is a single-nested page with contentplaceholder controls that match the names in your nested master.&amp;nbsp; You can then switch to design-view and edit the content and all controls on your page.&amp;nbsp; When you run the page, though, it will use the nested “submaster.master” (or any other master page you specify) to run.&lt;br /&gt;&lt;br /&gt;Update: Brian also pointed out to me that you can leave the MasterPageFile attribute value as &quot;&quot; and the designer will then automatically render a test master page that just lists all of the content-placeholder controls in editable regions.&amp;nbsp; This might allow you to avoid having to define a test master page for your site.&lt;br /&gt;&lt;br /&gt;Here is a simple &lt;a href=&quot;http://www.scottgu.com/BlogPosts/NestedMaster/Nestedsample.zip&quot;&gt;sample&lt;/a&gt; that shows all this working (you can switch the default.aspx page to use either the submaster.master or submaster2.master page that is based on mainmaster.master).&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Hope this helps and is useful,&lt;br /&gt;&lt;font size=&quot;2&quot; face=&quot;Arial&quot;&gt;Scott&lt;/font&gt;</description>
  <comments>http://vindee.livejournal.com/5672.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/5403.html</guid>
  <pubDate>Thu, 11 Oct 2007 09:40:07 GMT</pubDate>
  <title>Basic C# Predicate Generic Delegate Example</title>
  <link>http://vindee.livejournal.com/5403.html</link>
  <description>Predicate Generic Delegates are very useful in the 2.0 Framework.&amp;nbsp; I first came across Predicate Generic Delegates a couple of months ago when creating a sequencing algorithm for a large project.&amp;nbsp; Part of the sequencing involved enumerating List&amp;lt;T&amp;gt;&apos;s and removing / replacing items that met / failed to meet certain criteria.&amp;nbsp; First I tried simply enumerating the collection, analyzing the data, and removing / replacing said item.&amp;nbsp; It looked sort of like the following basic &quot;Hello World&quot; example.&lt;br /&gt;&lt;br /&gt;List&amp;lt;string&amp;gt; list = new List&amp;lt;string&amp;gt;();&lt;br /&gt;list.Add(&quot;one&quot;);&lt;br /&gt;list.Add(&quot;two&quot;);&lt;br /&gt;list.Add(&quot;three&quot;);&lt;br /&gt;list.Add(&quot;four&quot;);&lt;br /&gt;list.Add(&quot;fivehundredandfiftyfive&quot;);&lt;br /&gt;&lt;br /&gt;foreach (string s in list)&lt;br /&gt;&amp;nbsp;&amp;nbsp; if (string.Compare(s, &quot;three&quot;) == 0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; list.Remove(s); // InvalidOperationException&lt;br /&gt;&lt;br /&gt;The InvalidOperationException is caused (in this case) when the call to IEnumerator.MoveNext is made. The reason the exception is thrown is because the collection objects were modified after the enumerator was created.&lt;br /&gt;&lt;br /&gt;Collection was modified; enumeration operation may not execute&lt;br /&gt;&lt;br /&gt;There is a way around this that is much safer and, in my opinion, much more elegant.&amp;nbsp; In using the same string collection above, let&apos;s say that you want to remove any items that are &quot;three&quot;.&amp;nbsp; The Predicate delegate returns a bool reflecting if certain criteria was met. Here is an example of a Predicate using an anonymous delegate.&lt;br /&gt;&lt;br /&gt;list.RemoveAll(delegate(string s)&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;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return string.Compare(s, &quot;three&quot;) == 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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&lt;br /&gt;You can also create named methods instead of anonymous delegates. I created 2 simple ones for use with the original collection of strings.&lt;br /&gt;&lt;br /&gt;static bool RemoveThree(string s)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; return string.Compare(s, &quot;three&quot;) == 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;static bool RemoveLongLength(string s)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; return s.Length &amp;gt; 4;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;To use these methods is as simple as:&lt;br /&gt;&lt;br /&gt;list.RemoveAll(RemoveThree);&lt;br /&gt;list.RemoveAll(RemoveLongLength);&lt;br /&gt;&lt;br /&gt;Predicates can get more useful once you understand the basic premise. These examples are very &quot;Hello World&quot;-ey but definitely convey the usefulness.</description>
  <comments>http://vindee.livejournal.com/5403.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/4905.html</guid>
  <pubDate>Thu, 11 Oct 2007 09:26:52 GMT</pubDate>
  <title>Connecting an ObjectDataSource to a DataTable in Code-behind</title>
  <link>http://vindee.livejournal.com/4905.html</link>
  <description>&lt;asp:objectdatasource runat=&quot;”server”&quot; selectmethod=&quot;”GetItemCollectionByFirstNameLastName”&quot; typename=&quot;”Framework.Collections”&quot;&gt;&lt;selectparameters&gt;When placing a server-side control on an ASPX page, your code looks similar to:&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:ObjectDataSource ID=”odsLookupItemList” runat=”server”&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SelectMethod=”GetItemCollectionByFirstNameLastName”&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; TypeName=”Framework.Collections”&amp;gt;&lt;br /&gt;&amp;lt;SelectParameters&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ControlParameter ControlID=”txtFirstName”&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; Name=”firstName” PropertyName=”Text” Type=”String” /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:ControlParameter ControlID=”txtLastName”&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; Name=”lastName” PropertyName=”Text” Type=”String” /&amp;gt;&lt;br /&gt;&amp;lt;/SelectParameters&amp;gt;&lt;br /&gt;&amp;lt;/asp:ObjectDataSource&amp;gt;&lt;br /&gt;&lt;br /&gt;That’s fine and dandy; however, sometimes you don’t want the ODS to fire off on Page_Load, but after an event has occured on the page, such as, in this case, searching for an Item object by first or last name.&lt;br /&gt;&lt;br /&gt;ObjectDataSource odsLookupItemList = new ObjectDataSource();&lt;br /&gt;odsLookupItemList.SelectMethod = “GetItemCollectionByFirstOrLastName”;&lt;br /&gt;odsLookupParent.TypeName = “Framework.Collections”;&lt;br /&gt;&lt;br /&gt;odsLookupItemList.SelectParameters.Add(“firstName”, TypeCode.String, txtFirstName.Text);&lt;br /&gt;odsLookupItemList.SelectParameters.Add(“lastName”, TypeCode.String, txtLastName.Text);&lt;br /&gt;&lt;br /&gt;DataTable dt = (DataTable)odsLookupParent.Select();&lt;br /&gt;&lt;br /&gt;You can also shortcut, when creating the ODS object, to save a few lines of code, by placing the TypeName and Select Method into an overloaded constructor:&lt;br /&gt;&lt;br /&gt;ObjectDataSource ods = new ObjectDataSource(“Framework.Collections”, “GetItemCollectionByFirstOrLastName”);&lt;br /&gt;&lt;br /&gt;This requires your ODS to return a result that is either convertable to the object you are trying to place it in (such as a DataTable) or, even better, placing it back in it’s original object type (without casting) and iterating through as necessary for your application.&lt;br /&gt;&lt;br /&gt;Now, rather than firing off (and, if the SelectParameters are null, producing nothing), the actual ObjectDataSource isn’t even created until it’s necessary and it’s event, such as a Button’s Click event, has occured.&lt;br /&gt;&lt;/selectparameters&gt;&lt;/asp:objectdatasource&gt;</description>
  <comments>http://vindee.livejournal.com/4905.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/4216.html</guid>
  <pubDate>Fri, 10 Aug 2007 05:47:40 GMT</pubDate>
  <title>Bourne Ultimatum</title>
  <link>http://vindee.livejournal.com/4216.html</link>
  <description>Watched Bourne Ultimatum Y&apos;day.The third installment of the Bourne series. &lt;br /&gt;&lt;br /&gt;Review from imdb..&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Perhaps One of the Greatest Motion Picture Trilogies of our Time&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;I don&apos;t hand out ten star ratings easily. A movie really has to impress me, and The Bourne Ultimatum has gone far beyond that. Furthermore, this trilogy has come together so nicely, that I believe it to be one of the greatest motion picture trilogies of our time. Though all three films could not be any more different from the Ludlum novels, they still stand as a powerful landmark in cinematic achievement. The Bourne Ultimatum made me want to cry that the series was complete, yet I could not even attempt to stop smiling for hours.&lt;br /&gt;&lt;br /&gt;From the moment that the opening title appeared, I knew we were in for a ride. Paul Greengrass has done it again. Everything we love from the previous Bourne films is here once again: the action, the dialogue, and of course the shaky camera. However for me, that last one was never a problem. I think it adds to the suspense.&lt;br /&gt;&lt;br /&gt;I will be back to see this film several times before it is released on DVD, simply because it is genius. It is a perfectly satisfying conclusion, and should stand the test of time as a fantastic movie, and altogether, an unforgettable trilogy.</description>
  <comments>http://vindee.livejournal.com/4216.html</comments>
  <category>movies</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/3990.html</guid>
  <pubDate>Fri, 10 Aug 2007 05:44:34 GMT</pubDate>
  <title>Its Official Finally</title>
  <link>http://vindee.livejournal.com/3990.html</link>
  <description>Redwood City, Calif. – August 2, 2007 – Electronic Arts Inc. (NASDAQ: ERTS) and Crytek, award-winning developers of Far Cry, today announced that CrysisTM, will be hitting retail stores in North America and Europe on November 16, 2007 exclusively for the PC. A technical achievement featuring stunning DirectX 10 and DirectX 9 visuals, cunning gameplay, and an epic story, Crysisis recognized as one of the most anticipated PC games and first person shooters of 2007, recently winning Best PC game from the Game Critics Awards: Best of E3 2007.</description>
  <comments>http://vindee.livejournal.com/3990.html</comments>
  <category>games</category>
  <lj:mood>anxious</lj:mood>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/3754.html</guid>
  <pubDate>Mon, 06 Aug 2007 03:52:23 GMT</pubDate>
  <title>House of sand and fog</title>
  <link>http://vindee.livejournal.com/3754.html</link>
  <description>Awesome movie!!!!&lt;br /&gt;&lt;br /&gt;Here is a review from imdb... &lt;br /&gt;&lt;br /&gt;&lt;b&gt;Brilliant, but Excruciatingly Tragic &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Since antiquity, tragedy has been regarded as the highest and most important form of drama for its ability to arouse the deepest sense of pathos and empathy from its audience.&lt;br /&gt;&lt;br /&gt;Remind yourself of this if you choose to watch &apos;House of Sand and Fog.&apos; I can state emphatically that &apos;House&apos; is one of the most artfully directed and acted films of the last five years, but make no mistake: it is a tragedy, and only the hardest and most jaded of hearts will emerge from the experience undisturbed. It is a dissertation on sorrow, and while I&apos;m glad I saw it, I can&apos;t say I had a whole lot of fun.&lt;br /&gt;&lt;br /&gt;&apos;House&apos; was directed by newcomer Vadim Perelman, who also adapted the screenplay from the acclaimed novel by Andre Dubus III. Perelman tweaks the story in some respects but is ultimately faithful to the novel&apos;s style and sensibility. As in the novel, the story is filtered through alternating perspectives, the foremost of which are Behrani (Ben Kingsley), a Persian ex-pat and a former high-ranking officer under the Shah in Iran, and Kathy Lazaro (Jennifer Connelly), a severely depressed recovering alcoholic tenuously holding onto sobriety but nevertheless gradually self-destructing after the collapse of her marriage.&lt;br /&gt;&lt;br /&gt;The two characters are drawn together, appropriately enough, by the house of the title, a small but elegant coastal property in fictional Pacific County, California (the novel sets the house in Malibu). The house belongs to Kathy, who inherited it (along with her older brother, who lives elsewhere) from her deceased father. Kathy has become a victim of a bureaucratic snafu--she has been erroneously charged with delinquency on taxes for a non-existent business--but due to her textbook depressive refusal to open and answer her mail, she wakes up one morning to find that the county has evicted her and put her property up for auction.&lt;br /&gt;&lt;br /&gt;Enter Colonel Behrani, a regal man of aristocratic bearing whose ruthless determination to maintain the standard of living his family has always been accustomed to is simultaneously honorable and pathetic. Behrani is the story&apos;s tragic hero in the classical sense. Behrani has been saving and shrewdly watching the classified ads waiting for a chance to snap up a foreclosure at a cut rate price, make modest renovations, and then resell the property at peak market value in order to acquire a six-figure nest-egg to fund his son&apos;s education and improve his family&apos;s future prospects in the US. Fortuitously, the house he buys at auction--Kathy&apos;s house--is a coastal property bearing some resemblance to his former home on the Caspian Sea, back before his family fled Iran. The house is seen in an early flashback, an eerie montage wherein a younger Behrani in full-dress service uniform observes as a row of enormous trees are severed at the trunk so that the sea will be visible from the balcony where he stands.&lt;br /&gt;&lt;br /&gt;To elaborate the plot further would be too revealing, so I&apos;ll simply say that the lead performances in this film are sublime. I didn&apos;t think at first that I&apos;d be able to believe the stunningly beautiful Jennifer Connelly as Kathy, a woman who redefines the term &apos;self-destructive,&apos; and yet Connelly manages once again as she did in &apos;A Beautiful Mind&apos; to prove that her talent and skill match or even exceed the looks. It really goes without saying that Ben Kingsley&apos;s Behrani is a stunning performance--Kingsley is a mesmerizingly charismatic screen presence and a chameleonic character actor; few actors in the history of film have been able to so convincingly disappear into their characters while projecting such a distinctive, distinguished persona. Both actors master these demanding roles such that the audience feels a broad scope of contradictory and ambiguous emotions towards their characters; neither is completely sympathetic nor despicable, and though in the Aristotelian sense Behrani is the story&apos;s tragic hero, it&apos;s resolution remains ambiguous, as does the ultimate responsibility for the tragic denouement.&lt;br /&gt;&lt;br /&gt;The direction of the film has its occasional hitches, but many of Vadim Perelman&apos;s shots are brilliantly captivating. The Northern California coastline is exploited to maximum effect, and Perelman offers numerous shots and angles of seamless appeal--they are original and engaging without feeling forced or consciously &apos;film-schoolish.&apos; It&apos;s quite a beautiful movie to look at, from the meticulous arrangement of the Behrani&apos;s luxurious furniture and decorations to the patience with which Perelman lets his actors&apos; nuanced facial expressions and physical gestures unfold the depths of their characters.&lt;br /&gt;&lt;br /&gt;I have some slight reservation about recommending the film simply because its tragedy is so unmerciful. And there are moments where you may find yourself exasperated with the characters and unwilling to maintain your sympathy for them. Personally, I think it&apos;s worth a look for the quality of the performances alone. It&apos;s also quite original and distinctive in style. It&apos;s devastatingly sad, however, and so should be reserved for appropriate moods.</description>
  <comments>http://vindee.livejournal.com/3754.html</comments>
  <category>movies</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://vindee.livejournal.com/3519.html</guid>
  <pubDate>Tue, 31 Jul 2007 04:45:09 GMT</pubDate>
  <title>LINQ</title>
  <link>http://vindee.livejournal.com/3519.html</link>
  <description>.NET Language-Integrated Query&lt;br /&gt;&lt;br /&gt;After two decades, the industry has reached a stable point in the evolution of object-oriented (OO) programming technologies. Programmers now take for granted features like classes, objects, and methods. In looking at the current and next generation of technologies, it has become apparent that the next big challenge in programming technology is to reduce the complexity of accessing and integrating information that is not natively defined using OO technology. The two most common sources of non-OO information are relational databases and XML.&lt;br /&gt;&lt;br /&gt;Rather than add relational or XML-specific features to our programming languages and runtime, with the LINQ project we have taken a more general approach and are adding general-purpose query facilities to the .NET Framework that apply to all sources of information, not just relational or XML data. This facility is called .NET Language-Integrated Query (LINQ).&lt;br /&gt;&lt;br /&gt;We use the term language-integrated query to indicate that query is an integrated feature of the developer&apos;s primary programming languages (for example, Visual C#, Visual Basic). Language-integrated query allows query expressions to benefit from the rich metadata, compile-time syntax checking, static typing and IntelliSense that was previously available only to imperative code. Language-integrated query also allows a single general purpose declarative query facility to be applied to all in-memory information, not just information from external sources.&lt;br /&gt;&lt;br /&gt;.NET Language-Integrated Query defines a set of general purpose standard query operators that allow traversal, filter, and projection operations to be expressed in a direct yet declarative way in any .NET-based programming language. The standard query operators allow queries to be applied to any IEnumerable&lt;t&gt;-based information source. LINQ allows third parties to augment the set of standard query operators with new domain-specific operators that are appropriate for the target domain or technology. More importantly, third parties are also free to replace the standard query operators with their own implementations that provide additional services such as remote evaluation, query translation, optimization, and so on. By adhering to the conventions of the LINQ pattern, such implementations enjoy the same language integration and tool support as the standard query operators.&lt;br /&gt;&lt;br /&gt;The extensibility of the query architecture is used in the LINQ project itself to provide implementations that work over both XML and SQL data. The query operators over XML (LINQ to XML) use an efficient, easy-to-use, in-memory XML facility to provide XPath/XQuery functionality in the host programming language. The query operators over relational data (LINQ to SQL) build on the integration of SQL-based schema definitions into the common language runtime (CLR) type system. This integration provides strong typing over relational data while retaining the expressive power of the relational model and the performance of query evaluation directly in the underlying store.&lt;br /&gt;&lt;br /&gt;                                          --MSDN</description>
  <comments>http://vindee.livejournal.com/3519.html</comments>
  <category>.net</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
