<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C0EFRnw-eyp7ImA9WhRbEE0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399</id><updated>2012-01-31T09:20:17.253Z</updated><category term="facebook" /><category term="vba" /><category term="flash" /><category term="virtualbox" /><category term="aa1" /><category term="tools" /><category term="security" /><category term="programming" /><category term="rule engines" /><category term="jrules" /><category term="ilog" /><category term="skype" /><category term="GOS" /><category term="vb" /><category term="chrome" /><category term="c#" /><category term="visual studio" /><category term="outlook" /><category term="sqlserver" /><category term="j2me" /><category term="android" /><category term="excel" /><category term="blogger" /><category term="ibm" /><category term="sql" /><category term="clearcase" /><category term="software" /><category term="xubuntu" /><category term="delicious" /><category term="drools" /><category term="monitor" /><category term=".net" /><category term="ubuntu" /><category term="cuil" /><category term="acer" /><category term="clearquest" /><category term="disqus" /><title>Random consultant</title><subtitle type="html">Random things I come across inside and outside of the IT world.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://randomconsultant.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/RandomConsultant" /><feedburner:info uri="randomconsultant" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>RandomConsultant</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry gd:etag="W/&quot;DUcDSHw9fSp7ImA9Wx5bGEU.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-2577281271864100029</id><published>2010-11-04T16:11:00.000Z</published><updated>2010-11-04T16:11:19.265Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-11-04T16:11:19.265Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="android" /><title>Fix when Android Market cannot download</title><content type="html">&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.ubergizmo.com/photos/2009/4/no_android_market.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://www.ubergizmo.com/photos/2009/4/no_android_market.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
On my &lt;a href="http://www.htc.com/www/product/g1/overview.html"&gt;G1&lt;/a&gt; running &lt;a href="http://developer.android.com/sdk/android-1.6-highlights.html"&gt;Android 1.6&lt;/a&gt;, I started to have problems with the Android Market. Any application that I tried to update or install resulted in an error message saying that the download was unsuccessful.&lt;br /&gt;
&lt;br /&gt;
Luckily with a bit of &lt;a href="http://www.google.co.uk/search?sourceid=chrome&amp;amp;ie=UTF-8&amp;amp;q=android+market+downloads+not+successful"&gt;googling&lt;/a&gt;, this is what I did to resolve the problem&lt;br /&gt;
&lt;br /&gt;
1. Open &lt;b&gt;Settings&lt;/b&gt;&lt;br /&gt;
2. Select &lt;b&gt;Applications&lt;/b&gt;&lt;br /&gt;
3. Select &lt;b&gt;Manage Applications&lt;/b&gt;&lt;br /&gt;
4. Select &lt;b&gt;Market &lt;/b&gt;and the select &lt;b&gt;Clear Cache&lt;/b&gt;&lt;br /&gt;
5. Repeat step 4 and clear the cache for &lt;b&gt;Google Apps&lt;/b&gt;, &lt;b&gt;Google Talk&lt;/b&gt; and &lt;b&gt;Checkin Service&lt;/b&gt;.&lt;br /&gt;
6. Restart your phone&lt;br /&gt;
&lt;br /&gt;
When you open the market it will ask you to login to your google account with your username and password. Once logged in , you will be able to download &amp;nbsp;and update apps. &lt;br /&gt;
&lt;br /&gt;
These instructions are based on:&lt;br /&gt;
&lt;a href="http://www.technipages.com/android-market-download-unsuccessful-error-fix.html"&gt;http://www.technipages.com/android-market-download-unsuccessful-error-fix.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-2577281271864100029?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/whUhC9M9E80" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2577281271864100029?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2577281271864100029?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/whUhC9M9E80/fix-when-android-market-cannot-download.html" title="Fix when Android Market cannot download" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2010/11/fix-when-android-market-cannot-download.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcNSHg6eyp7ImA9Wx5SEE0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-8498057738388488254</id><published>2010-08-05T11:58:00.003+01:00</published><updated>2010-08-05T12:01:39.613+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-08-05T12:01:39.613+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="chrome" /><category scheme="http://www.blogger.com/atom/ns#" term="flash" /><title>Install Flash in Google Chrome Portable without Admin Rights</title><content type="html">If you need to install Chrome and you don't have admin rights on your windows machine, then the best thing to do is to use a portable version, available from &lt;a href="http://portableapps.com/"&gt;portableapps.com&lt;/a&gt; :&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://portableapps.com/apps/internet/google_chrome_portable"&gt;http://portableapps.com/apps/internet/google_chrome_portable&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
You can put this anywhere on your machine or even on a usb stick.&lt;br /&gt;
&lt;br /&gt;
However if you want to use sites like youtube or google streetview, you will need Adobe Flash Player. As you don't have admin rights you will not be able to run the standard abobe installer.&lt;br /&gt;
&lt;br /&gt;
This is what you need to do instead:&lt;br /&gt;
&lt;br /&gt;
1. Download this file from Adobe: &lt;a href="http://fpdownload.macromedia.com/get/flashplayer/xpi/current/flashplayer-win.xpi"&gt;http://fpdownload.macromedia.com/get/flashplayer/xpi/current/flashplayer-win.xpi&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
2. Rename the file extenion from .xpi to .zip &lt;br /&gt;
&lt;br /&gt;
3. Use an unzip program like winzip or &lt;a href="http://www.7-zip.org/"&gt;7-zip&lt;/a&gt; to extract the contents&lt;br /&gt;
&lt;br /&gt;
4. Copy the files flashplayer.xpt and NPSWF32.dll from the contents of the zip to the folder \App\Chrome-Bin\5.0.375.55\Plugins &lt;br /&gt;
&lt;br /&gt;
This will be where you installed Google Chrome and the 5.0.365.55 folder might be named differently.&lt;br /&gt;
&lt;br /&gt;
5. Restart Chrome and enter this in the address bar: about:plugins . You should see Shockwave Flash listed as a plugin.&lt;br /&gt;
&lt;br /&gt;
6. Try out &lt;a href="http://www.youtube.com"&gt;youtube.com&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
These instructions are kind of based on:&lt;br /&gt;
&lt;a href="http://eurekatips.com/2009/05/05/flash-google-chrome-manual-permission-portable/724/"&gt;http://eurekatips.com/2009/05/05/flash-google-chrome-manual-permission-portable/724/&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-8498057738388488254?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/TTWe_CKMyHI" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8498057738388488254?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8498057738388488254?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/TTWe_CKMyHI/install-flash-in-google-chrome-portable.html" title="Install Flash in Google Chrome Portable without Admin Rights" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2010/08/install-flash-in-google-chrome-portable.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMNRHc_fip7ImA9WxFaGEU.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-8500044428555969628</id><published>2010-07-23T13:18:00.000+01:00</published><updated>2010-07-23T13:18:15.946+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-23T13:18:15.946+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="vb" /><category scheme="http://www.blogger.com/atom/ns#" term="vba" /><title>Run a command and read console output in VB6 / VBA</title><content type="html">Needed to run a command line program from code and read the input. Found this useful code to do it:&lt;br /&gt;
&lt;br /&gt;
&lt;script src="http://friendpaste.com/3aNELWiC1ed4bzApDhYIPl.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-8500044428555969628?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/wLK0vZsS1Og" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8500044428555969628?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8500044428555969628?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/wLK0vZsS1Og/run-command-and-read-console-output-in.html" title="Run a command and read console output in VB6 / VBA" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2010/07/run-command-and-read-console-output-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUDRHo_fCp7ImA9WxFUGUw.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-245334403797085537</id><published>2010-06-30T15:56:00.003+01:00</published><updated>2010-06-30T16:04:35.444+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-30T16:04:35.444+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="aa1" /><category scheme="http://www.blogger.com/atom/ns#" term="skype" /><category scheme="http://www.blogger.com/atom/ns#" term="acer" /><title>Official Skype Install for Acer Aspire 1 (aa1)</title><content type="html">Just got Skype running on my aa1 running Linpus Linux. There are a few blog posts out there with instructions, but I found an official download from Acer which is a lot more straight forward and worked for me where other methods didn't.&lt;br /&gt;&lt;br /&gt;Just follow the instructions at: &lt;a href="http://www.acer.com/aspireone/support/files/connect.html#002"&gt;http://www.acer.com/aspireone/support/files/connect.html#002&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;There are also instructions too on how to install support for 3G USB sticks (Huawei 3G dongles) which I haven't tried out , buy let me know if it works for you: &lt;a href="http://www.acer.com/aspireone/support/files/connect.html#003"&gt;http://www.acer.com/aspireone/support/files/connect.html#003&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-245334403797085537?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/Q1Smybkp_iM" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/245334403797085537?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/245334403797085537?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/Q1Smybkp_iM/official-skype-install-for-acer-aspire.html" title="Official Skype Install for Acer Aspire 1 (aa1)" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2010/06/official-skype-install-for-acer-aspire.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAEQXY4fyp7ImA9WxFQE04.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-6574754002679423470</id><published>2010-05-08T17:51:00.002+01:00</published><updated>2010-05-08T17:55:00.837+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-05-08T17:55:00.837+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="monitor" /><title>Half of LCD Monitor is Yellow</title><content type="html">I have a 19" LCD Monitor from LG . A little while ago the right half of the screen had a yellow tint to it. I played around with the cables for ages but it was no use.&lt;br /&gt;&lt;br /&gt;I considered buying a new monitor cable or even returning the monitor for repair until I tried out one thing. I went into the M&lt;strong&gt;onitor menu, went into settings and selected Factory Reset.... once I selected this, after a few seconds the screen was back to normal&lt;/strong&gt;... yipeee ... hope this helps somebody else out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-6574754002679423470?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/QNhD7W9zvJY" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/6574754002679423470?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/6574754002679423470?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/QNhD7W9zvJY/half-of-lcd-monitor-is-yellow.html" title="Half of LCD Monitor is Yellow" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2010/05/half-of-lcd-monitor-is-yellow.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEUMR3kycSp7ImA9WxJaGUU.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-8263500050825267658</id><published>2009-08-11T09:51:00.003+01:00</published><updated>2009-08-11T10:18:06.799+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-11T10:18:06.799+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="visual studio" /><title>Visual Studio Tricks</title><content type="html">I am going to keep this as an ongoing post with whatever tips and tricks I come across when using Visual Studio.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Show Active File In Solution Explorer&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When working with  big solutions and projects this is so useful. By default visual studio doesn't highlight the file that is active (i.e the one you are viewing) in Solution Explorer. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To activate this do the following:&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;Tools – Options – Projects and Solutions – Track Active Item in Solution Explorer&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" font-weight: bold; line-height: 19px; font-size:11px;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"    style="font-family:'Lucida Grande';font-size:100%;color:#7F7F7F;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 19px;font-size:11px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Credit for this tip goes to  &lt;a href="http://www.ronaldwidha.net/2008/11/26/visual-studio-show-active-file-in-solution-explorer/"&gt;Ronald Widha's blog &lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Use the Command Window to Search for Files&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;In Visual Studio I really miss the equivalent of Eclipse's CTRL - T shortcut to search for classes. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The next best thing I have found is to open the command window (  View &gt; Other Windows &gt; Command Window ) and type:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&gt;open &lt;i&gt;file you're searching for &lt;/i&gt;&lt;/div&gt;&lt;div&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;/div&gt;&lt;div&gt;and a little drop down will pop up of files that start with whatever you have typed in.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;More Tricks&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Also check out any of my blog entries tagged with &lt;a href="http://randomconsultant.blogspot.com/search/label/visual%20studio"&gt;visual studio&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"    style="font-family:'Lucida Grande';font-size:100%;color:#7F7F7F;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 19px;font-size:11px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"    style="font-family:'Lucida Grande';font-size:100%;color:#7F7F7F;"&gt;&lt;span class="Apple-style-span"  style=" line-height: 19px;font-size:11px;"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-8263500050825267658?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/PDBqVEnAXLY" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8263500050825267658?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8263500050825267658?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/PDBqVEnAXLY/visual-studio-tricks.html" title="Visual Studio Tricks" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2009/08/visual-studio-tricks.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0INR3ozcCp7ImA9WxJaGU0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-1932632220655417224</id><published>2009-08-10T13:30:00.005+01:00</published><updated>2009-08-10T14:06:36.488+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-10T14:06:36.488+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="xubuntu" /><category scheme="http://www.blogger.com/atom/ns#" term="flash" /><title>Installing flash for firefox in xubuntu</title><content type="html">This weekend I was trying to get the flash player installed on XUbuntu and working on firefox. Following the instructions on Adobe's site didn't work , but after a bit of googling this is what I did and it worked.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Download Adobe Flash Player from &lt;a href="http://get.adobe.com/flashplayer/otherversions/"&gt;http://get.adobe.com/flashplayer/otherversions/&lt;/a&gt;. Choose the tar.gz option.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;2. Extract the contents of the extracted file to your desktop . The file &lt;b&gt;libflashplayer.so&lt;/b&gt; should now be on your desktop&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;3. Open up a terminal window&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. Enter the following , and replace &lt;b&gt;username &lt;/b&gt;with your username.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;sudu su&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;cd &lt;span class="Apple-style-span" style="white-space: pre; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;/usr/lib/mozilla/plugins/&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;cp /home/&lt;b&gt;username&lt;/b&gt;&lt;username&gt;/desktop/libflashplayer.so .&lt;br /&gt;&lt;/username&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;cd /usr/lib/firefox/plugins/&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;cp /home/&lt;b&gt;username&lt;/b&gt;&lt;username&gt;/desktop/libflashplayer.so .&lt;/username&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;5. Restart firefox (maybe a couple of times)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="white-space: pre;"&gt;6. Test out &lt;a href="http://www.youtube.com/"&gt;youtube.com&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:100%;"&gt;&lt;span class="Apple-style-span"  style=" white-space: pre;font-size:13px;"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-1932632220655417224?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/jFC1iiQHC5Y" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/1932632220655417224?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/1932632220655417224?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/jFC1iiQHC5Y/installing-flash-for-firefox-in-xubuntu.html" title="Installing flash for firefox in xubuntu" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2009/08/installing-flash-for-firefox-in-xubuntu.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEYARX4zcCp7ImA9WxVVFko.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-8802784649358856703</id><published>2009-03-10T08:58:00.004Z</published><updated>2009-03-10T09:09:04.088Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-10T09:09:04.088Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="delicious" /><title>Show delicious saves and tags on blog</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_fh-NK6PsBnw/SbYsc9ycTpI/AAAAAAAAAHk/aqeecDiFZCo/s1600-h/delicioustagometer.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 320px; height: 41px;" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/SbYsc9ycTpI/AAAAAAAAAHk/aqeecDiFZCo/s320/delicioustagometer.jpg" alt="" id="BLOGGER_PHOTO_ID_5311481686664171154" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;This is a useful feature from &lt;a href="http://delicious.com/"&gt;delicious &lt;/a&gt;where you can show how many people have saved your page as a bookmark on &lt;a href="http://delicious.com"&gt;delicious &lt;/a&gt;and the tags people have used.&lt;br /&gt;&lt;br /&gt;You can probably see this at the bottom of this page.&lt;br /&gt;&lt;br /&gt;Just go to &lt;a href="http://delicious.com/help/tagometer"&gt;http://delicious.com/help/tagometer&lt;/a&gt; and it has a snippet of javascript to copy and paste into your page.&lt;br /&gt;&lt;br /&gt;To add a snippet of html/javascript to blogger have a look at the &lt;a href="http://help.blogger.com/bin/answer.py?hl=en&amp;amp;answer=112498#customizelayout"&gt;help site&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-8802784649358856703?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/KuL5H_6yDzc" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8802784649358856703?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8802784649358856703?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/KuL5H_6yDzc/show-delicious-saves-and-tags-on-blog.html" title="Show delicious saves and tags on blog" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_fh-NK6PsBnw/SbYsc9ycTpI/AAAAAAAAAHk/aqeecDiFZCo/s72-c/delicioustagometer.jpg" height="72" width="72" /><feedburner:origLink>http://randomconsultant.blogspot.com/2009/03/show-delicious-saves-and-tags-on-blog.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EGQ348eCp7ImA9WxJaGU0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-8789696575484704302</id><published>2009-03-04T15:18:00.006Z</published><updated>2009-08-10T14:07:02.070+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-10T14:07:02.070+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="visual studio" /><category scheme="http://www.blogger.com/atom/ns#" term="clearcase" /><title>Adding ClearCase commands to Visual Studio context menu</title><content type="html">If you are using Visual Studio and clearcase this is really useful.  This puts clearcase functions like opening the version tree into the menu when you right click on a file in solution explorer.&lt;br /&gt;&lt;br /&gt;1. The following link shows you how to add new menu items to the context menu when you select file in the solution explorer:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sharpregion.com/blog/?p=105&amp;amp;cpage=1"&gt;http://www.sharpregion.com/blog/?p=105&amp;amp;cpage=1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2 . Just add the following bit of code to the module ContextCommads or download the full file from &lt;a href="http://dl.getdropbox.com/u/427946/ContextCommands.vb"&gt;here&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://friendpaste.com/4dqpST1QKSho22fwz5tKTA.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Now Repeat steps 7 to 9 from the afore mentioned link &lt;a href="http://www.sharpregion.com/blog/?p=105&amp;amp;cpage=1"&gt;Extending the Visual-Studio Context-Menu&lt;/a&gt; for the following three subs :&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;VersionTree &lt;/span&gt;- this opens up the clearcase version tree for the selected file&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;HijackFileCommand&lt;/span&gt; - hjacks the selected file (makes it writeable)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;ClearCaseAnnotateCommand&lt;/span&gt; - calls the clearcase annotate command to show who and when each change was made on the selected file&lt;br /&gt;&lt;br /&gt;Thats it. Now right click on a file and you will have these options available&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-8789696575484704302?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/1bvWqKk1JAs" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8789696575484704302?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8789696575484704302?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/1bvWqKk1JAs/adding-clearcase-commands-to-visual.html" title="Adding ClearCase commands to Visual Studio context menu" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2009/03/adding-clearcase-commands-to-visual.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0YFQn8yfCp7ImA9WxNTFU0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-7790368975468419279</id><published>2009-02-26T10:18:00.016Z</published><updated>2009-08-17T11:31:53.194+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-17T11:31:53.194+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tools" /><category scheme="http://www.blogger.com/atom/ns#" term="software" /><title>My top tools that every software developer should have</title><content type="html">Here's my list of tools that make my day to day work a lot easier as a developer and some tools which are just useful to have on your desktop&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://notepad-plus.sourceforge.net/"&gt;Notepadd ++&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now this is the dog's dangly bits on text editors. It has built in syntax highlighters for nearly all formats, you can add your own syntax highlighters. You can open files in multiple tabs , firefox style and a whole host of other useful features. I use it for sql file edits, viewing log files , xml editing ,  batch file editing , etc , etc.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://notepad-plus.sourceforge.net/commun/screenshots/scrsh_lexerXML.gif"&gt;&lt;img src="http://notepad-plus.sourceforge.net/commun/screenshots/scrsh_lexerXML_small.gif" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Free: &lt;span style="font-weight: bold;"&gt;YES&lt;/span&gt;&lt;a href="http://notepad-plus.sourceforge.net/uk/site.htm"&gt;&lt;br /&gt;http://notepad-plus.sourceforge.net/uk/site.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.baremetalsoft.com/baregrep/"&gt;BareGrep&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The fastest file searcher I have found that's free! It can search through sub directories and use regexp if you need to. Very useful for search through tons of log files.&lt;br /&gt;&lt;br /&gt;Free : &lt;span style="font-weight: bold;"&gt;YES &lt;/span&gt;, but $25 USD version has a few more options&lt;br /&gt;&lt;a href="http://www.baremetalsoft.com/baregrep/"&gt;http://www.baremetalsoft.com/baregrep/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.baremetalsoft.com/baretail/index.php"&gt;BareTail&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Acts like a unix tail command but for windows. I.E. it monitors a text file and keeps updating whenever a new line is added. Perfect for log files. A nice feature is that it can highlight particular strings in whatever format you wish&lt;br /&gt;&lt;br /&gt;Free : &lt;span style="font-weight: bold;"&gt;YES &lt;/span&gt;, and $25 USD version also has a few more options&lt;br /&gt;&lt;a href="http://www.baremetalsoft.com/baretail/"&gt;http://www.baremetalsoft.com/baretail/&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.scootersoftware.com/"&gt;Beyond Compare&lt;/a&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Definately the best file (and folder) comparison tool I have used. A perfect replacement to the crappy compare tool in clearcase (See my post &lt;a href="http://randomconsultant.blogspot.com/2009/01/use-beyond-compare-in-clearcase.html"&gt;Use Beyond Compare in Clearcase&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Free : 30 day evaluation&lt;br /&gt;&lt;a href="http://www.scootersoftware.com/"&gt;http://www.scootersoftware.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://winmerge.org/"&gt;WinMerge&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you don't want to shell out for Beyond Compare , winmerge is a pretty good substitute as it is open source,  so yes it is free. One feature it does have that Beyond Compare doesn't is that it does code syntax highlighting in the comparison viewer.&lt;br /&gt;&lt;br /&gt;Free : &lt;span style="font-weight: bold;"&gt;YES&lt;/span&gt;&lt;a href="http://winmerge.org/"&gt;&lt;br /&gt;http://winmerge.org/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://rocketdock.com/"&gt;RocketDock&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A thing to place your shortcuts, and makes your windows pc look a bit like a mac. Wow , other geeky developers . See the youtube vid.&lt;br /&gt;&lt;br /&gt;&lt;object height="344" width="425"&gt;&lt;param name="movie" value="http://www.youtube.com/v/d6UVb15it6A&amp;amp;hl=en&amp;amp;fs=1"&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;embed src="http://www.youtube.com/v/d6UVb15it6A&amp;amp;hl=en&amp;amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" height="344" width="425"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;Free : &lt;span style="font-weight: bold;"&gt;YES&lt;/span&gt;&lt;br /&gt;&lt;a href="http://rocketdock.com/"&gt;http://rocketdock.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;br /&gt;&lt;a href="http://www.executor.dk/"&gt;Executor&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A great application to start up any application installed. Very quick and intuitive to use.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://home25.inet.tele.dk/mb/executor/images/alphaskin.jpg" alt="Executor" /&gt;&lt;br /&gt;&lt;br /&gt;Free: &lt;span style="font-weight: bold;"&gt;YES&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.executor.dk/"&gt;http://www.executor.dk/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.stardock.com/products/fences/"&gt;Fences&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Organise icons on your desktop into little areas called fences. Very useful&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.stardock.com/products/fences/images/screenshots/DesktopFences_ss6.jpg"&gt;&lt;img src="http://www.stardock.com/products/fences/images/screenshots/DesktopFences_ss6.jpg" height="172" width="275" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Free: &lt;span style="font-weight: bold;"&gt;YES&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.stardock.com/products/fences/"&gt;http://www.stardock.com/products/fences/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.officerecovery.com/freeundelete/"&gt;FreeUndelete&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It does what is says on the tin! It undeletes file you thought you lost! Can be a lifesaver, actually it bailed me out today!.&lt;br /&gt;&lt;br /&gt;Free : &lt;span style="font-weight: bold;"&gt;YES&lt;/span&gt;&lt;br /&gt;&lt;a href="http://www.officerecovery.com/freeundelete/"&gt;http://www.officerecovery.com/freeundelete/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;Process Explorer&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is a super replacement for windows task manager. Get detailed info on each process and easily see parent child processes.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i.technet.microsoft.com/bb896653.ProcessExplorer%28en-us,MSDN.10%29.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Free: &lt;span style="font-weight: bold;"&gt;YES&lt;/span&gt;&lt;br /&gt;&lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx&lt;/a&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://www.voidtools.com/"&gt;Everything Search Engine&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is a really great tool to search for files . It is really lightweight and superfast. It indexes in the background , so when you search for something it is almost instant.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.voidtools.com/sssmall.jpg" alt="Search Everything" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Free : &lt;b&gt;YES&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.voidtools.com/"&gt;http://www.voidtools.com/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:7;"&gt;&lt;span class="Apple-style-span" style="font-size: 48px;"&gt;&lt;span class="Apple-style-span" style="font-size: 18px; "&gt;&lt;a href="http://windirstat.info/"&gt;WinDirStat&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;If you are always running out of disk space, this is the tool for you. It shows you your big folders and files and has a nice little map of your drive.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If you want something to work cross platform see some other suggestions from &lt;a href="http://lifehacker.com/219058/geek-to-live--visualize-your-hard-drive-usage"&gt;lifehacker&lt;/a&gt;:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://lifehacker.com/219058/geek-to-live--visualize-your-hard-drive-usage"&gt;http://lifehacker.com/219058/geek-to-live--visualize-your-hard-drive-usage&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://windirstat.info/images/windirstat.jpg"&gt;&lt;img src="http://windirstat.info/images/windirstat-small.jpg" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Free : &lt;b&gt;YES&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://windirstat.info/"&gt;http://windirstat.info/&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-7790368975468419279?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/sq2P3PiaKME" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/7790368975468419279?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/7790368975468419279?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/sq2P3PiaKME/my-top-tools-that-every-software.html" title="My top tools that every software developer should have" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2009/02/my-top-tools-that-every-software.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkEDQ3g6eCp7ImA9WxVXFE4.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-4881108418578091169</id><published>2009-02-12T11:22:00.002Z</published><updated>2009-02-12T11:37:52.610Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-12T11:37:52.610Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="blogger" /><category scheme="http://www.blogger.com/atom/ns#" term="facebook" /><category scheme="http://www.blogger.com/atom/ns#" term="disqus" /><title>Facebook Connect on Blogger</title><content type="html">This post is to test out using &lt;a href="http://developers.facebook.com/connect.php"&gt;facebook connect&lt;/a&gt; on blogger using &lt;a href="http://disqus.com/"&gt;disqus&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So leave a comment and see what happens.&lt;br /&gt;&lt;br /&gt;I followed the instructions from:&lt;br /&gt;&lt;a href="http://manofmanywords.blogspot.com/2008/12/do-you-have-blog-on-blogger-wordpress.html"&gt;&lt;br /&gt;http://manofmanywords.blogspot.com/2008/12/do-you-have-blog-on-blogger-wordpress.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-4881108418578091169?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/lQ7Qh_d7oTM" height="1" width="1"/&gt;</content><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/4881108418578091169?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/4881108418578091169?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/lQ7Qh_d7oTM/facebook-connect-on-blogger.html" title="Facebook Connect on Blogger" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><feedburner:origLink>http://randomconsultant.blogspot.com/2009/02/facebook-connect-on-blogger.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYBSH06fip7ImA9WxVQEEw.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-2991111107165906983</id><published>2009-01-26T21:56:00.004Z</published><updated>2009-01-26T22:49:19.316Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-26T22:49:19.316Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="excel" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><category scheme="http://www.blogger.com/atom/ns#" term="sqlserver" /><title>Export SQL Server tables to Excel in c#</title><content type="html">This piece of code executes a sql query on a sql server database and returns the result into a excel workbook (with column headings included).&lt;br /&gt;&lt;br /&gt;Remember to add the following references  (Project &gt; Add Reference &gt; COM)&lt;br /&gt;&lt;br /&gt;Microsoft Excel 12.0 Object Library (or an older version)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Collections&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Generic&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Linq&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Data&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;SqlClient&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Microsoft&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Office&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Interop&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Reflection&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;namespace&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ExportDBTablesToExcel&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; &lt;strong&gt;class&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ExportToExcel&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;private&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Application&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;private&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Workbook&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;workbook&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;strong&gt;private&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Worksheet&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;previousWorksheet&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;private&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Range&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;workSheet_range&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;private&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;folder&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;private&lt;/strong&gt; &lt;strong&gt;static&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;CONNECTION_STR&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"Data Source=(local);Database=DATABASE_NAME;"&lt;/span&gt;&lt;br /&gt;                                                      &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"Integrated Security=SSPI;"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;public&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ExportToExcel&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;folder&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;strong&gt;this&lt;/strong&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;folder&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;folder&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;strong&gt;this&lt;/strong&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;strong&gt;this&lt;/strong&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;workbook&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;strong&gt;this&lt;/strong&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;previousWorksheet&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;strong&gt;this&lt;/strong&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;workSheet_range&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;createDoc&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;private&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;createDoc&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;strong&gt;try&lt;/strong&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;new&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Application&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Visible&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;false&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;workbook&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Workbooks&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Add&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;strong&gt;catch&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Exception&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Write&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;strong&gt;finally&lt;/strong&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;shutDown&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;strong&gt;try&lt;/strong&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;workbook&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Quit&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;strong&gt;catch&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Exception&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Write&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;strong&gt;finally&lt;/strong&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ExportTable&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;query&lt;/span&gt;,&lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;sheetName&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;SqlConnection&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;myConnection&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;new&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;SqlConnection&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;CONNECTION_STR&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;SqlDataReader&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;strong&gt;try&lt;/strong&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Worksheet&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Worksheet&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;workbook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Sheets&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Add&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;XlSheetType&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;xlWorksheet&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Name&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;sheetName&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;previousWorksheet&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;myConnection&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Open&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;SqlCommand&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;myCommand&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;new&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;SqlCommand&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;query&lt;/span&gt;,&lt;br /&gt;                                                      &lt;span style="color: rgb(32, 64, 160);"&gt;myConnection&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;myCommand&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ExecuteReader&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;columnCount&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;FieldCount&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;strong&gt;for&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;columnCount&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;                 &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Write&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;GetName&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"&lt;span style="color: rgb(119, 221, 119);"&gt;\t&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                 &lt;span style="color: rgb(32, 64, 160);"&gt;createHeaders&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt;, &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;GetName&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;rowCounter&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;             &lt;strong&gt;while&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Read&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;                 &lt;strong&gt;for&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;columnCount&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                 &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;                     &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;                     &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Write&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;GetName&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"&lt;span style="color: rgb(119, 221, 119);"&gt;\t&lt;/span&gt;"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                     &lt;span style="color: rgb(32, 64, 160);"&gt;addData&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;rowCounter&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;GetName&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;n&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                 &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;                 &lt;span style="color: rgb(32, 64, 160);"&gt;rowCounter&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;strong&gt;catch&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Exception&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;strong&gt;finally&lt;/strong&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;             &lt;strong&gt;if&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;!&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt;&lt;strong&gt;null&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&amp;amp;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;!&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;IsClosed&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;                 &lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Close&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;strong&gt;if&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;myConnection&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;!&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;                 &lt;span style="color: rgb(32, 64, 160);"&gt;myConnection&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Close&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;myReader&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;myConnection&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;createHeaders&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Worksheet&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt;,&lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;row&lt;/span&gt;, &lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;col&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;htext&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Cells&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;row&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;col&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;htext&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;addData&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Worksheet&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt;,&lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;row&lt;/span&gt;, &lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;col&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;data&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;worksheet&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Cells&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;row&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;col&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;data&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;public&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;SaveWorkbook&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;      &lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;String&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;folderPath&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"C:&lt;span style="color: rgb(119, 221, 119);"&gt;\\&lt;/span&gt;My Files&lt;span style="color: rgb(119, 221, 119);"&gt;\\&lt;/span&gt;"&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;strong&gt;this&lt;/strong&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;folder&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;strong&gt;if&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;!&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;IO&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Directory&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Exists&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;folderPath&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;IO&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Directory&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;CreateDirectory&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;folderPath&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;fileNameBase&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"db"&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;String&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;fileName&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;fileNameBase&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ext&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;".xlsx"&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;counter&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;strong&gt;while&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;IO&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;File&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Exists&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;folderPath&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;fileName&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;ext&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;fileName&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;fileNameBase&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;counter&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;counter&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;fileName&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;fileName&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;ext&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;filePath&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;folderPath&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;fileName&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;strong&gt;try&lt;/strong&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;workbook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;SaveAs&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;filePath&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;XlFileFormat&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;xlWorkbookDefault&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;XlSaveAsAccessMode&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;xlNoChange&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;Missing&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;strong&gt;catch&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Exception&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;             &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     &lt;strong&gt;static&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Main&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;args&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;ExportToExcel&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;export&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;new&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ExportToExcel&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;args&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;export&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ExportTable&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"SELECT * FROM t_table1"&lt;/span&gt;,&lt;span style="color: rgb(0, 128, 0);"&gt;"t_table1"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;export&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ExportTable&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"SELECT * FROM t_table2"&lt;/span&gt;,&lt;span style="color: rgb(0, 128, 0);"&gt;"t_table2"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;export&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ExportTable&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"SELECT * FROM t_table3"&lt;/span&gt;,&lt;span style="color: rgb(0, 128, 0);"&gt;"t_table3"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;export&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;SaveWorkbook&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;         &lt;span style="color: rgb(32, 64, 160);"&gt;export&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;shutDown&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;This code is based on the following links:&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/cs/Excel_and_C_.aspx"&gt;&lt;br /&gt;http://www.codeproject.com/KB/cs/Excel_and_C_.aspx&lt;/a&gt;&lt;br /&gt;and&lt;br /&gt;&lt;a href="http://www.codeproject.com/KB/database/sql_in_csharp.aspx?fid=16002&amp;amp;df=90&amp;amp;mpp=25&amp;amp;noise=3&amp;amp;sort=Position&amp;amp;view=Quick&amp;amp;fr=26&amp;amp;select=1490011"&gt;http://www.codeproject.com/KB/database/sql_in_csharp.aspx?fid=16002&amp;amp;df=90&amp;amp;mpp=25&amp;amp;noise=3&amp;amp;sort=Position&amp;amp;view=Quick&amp;amp;fr=26&amp;amp;select=1490011&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-2991111107165906983?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/AS-KeKj_9M8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/2991111107165906983/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=2991111107165906983" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2991111107165906983?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2991111107165906983?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/AS-KeKj_9M8/export-sql-server-tables-to-excel-in-c.html" title="Export SQL Server tables to Excel in c#" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2009/01/export-sql-server-tables-to-excel-in-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEICRXoyeip7ImA9WxVRFUk.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-2775243050915201654</id><published>2009-01-21T12:21:00.003Z</published><updated>2009-01-21T12:56:04.492Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-21T12:56:04.492Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="outlook" /><category scheme="http://www.blogger.com/atom/ns#" term=".net" /><category scheme="http://www.blogger.com/atom/ns#" term="excel" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title>Read an Excel document and Send an email from outlook in c# .net</title><content type="html">This is a handy example  if you need to read an excel document and/or send an email from outlook in some c# code.&lt;br /&gt;&lt;br /&gt;Remember to add the following references  (Project &gt; Add Reference &gt; COM)&lt;br /&gt;&lt;br /&gt;Microsoft Excel 12.0 Object Library&lt;br /&gt;Microsoft Office 12.0 Object Library&lt;br /&gt;Microsoft Outlook 12.0 Object Library&lt;br /&gt;&lt;br /&gt;if you have older versions of office , they should work too.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Collections&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Generic&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Linq&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;System&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Microsoft&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Office&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Interop&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Microsoft&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Office&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Interop&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;using&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Microsoft&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Office&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Core&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;namespace&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;StatusNotifier&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;  &lt;strong&gt;class&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;StatusNotifier&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;      &lt;strong&gt;static&lt;/strong&gt; &lt;strong&gt;void&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Main&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;args&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Path&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; @&lt;span style="color: rgb(0, 128, 0);"&gt;"D:&lt;span style="color: rgb(119, 221, 119);"&gt;\M&lt;/span&gt;yExcelFile.xls"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 68);"&gt;// initialize the Excel Application class&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ApplicationClass&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;new&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ApplicationClass&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 68);"&gt;// create the workbook object by opening the excel file.&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Workbook&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;workBook&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Workbooks&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Open&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Path&lt;/span&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;,&lt;br /&gt;                                                       &lt;strong&gt;true&lt;/strong&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(255, 0, 0);"&gt;5&lt;/span&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;,&lt;br /&gt;                                                       &lt;strong&gt;true&lt;/strong&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;XlPlatform&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;xlWindows&lt;/span&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(0, 128, 0);"&gt;"&lt;span style="color: rgb(119, 221, 119);"&gt;\t&lt;/span&gt;"&lt;/span&gt;,&lt;br /&gt;                                                       &lt;strong&gt;false&lt;/strong&gt;,&lt;br /&gt;                                                       &lt;strong&gt;false&lt;/strong&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;,&lt;br /&gt;                                                       &lt;strong&gt;true&lt;/strong&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;,&lt;br /&gt;                                                       &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 68);"&gt;// get the active worksheet using sheet name or active sheet&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Worksheet&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;workSheet&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Worksheet&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;workBook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Worksheets&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;index&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 68);"&gt;// This row,column index should be changed as per your need.&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 68);"&gt;// i.e. which cell in the excel you are interesting to read.&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;object&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;rowIndex&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;2&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;object&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;colA&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;object&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;colB&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;2&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;        &lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;StringBuilder&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;new&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;StringBuilder&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;AppendLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"My Message"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;AppendLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"--------------"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;AppendLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;""&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;  &lt;span style="color: rgb(68, 68, 68);"&gt;//----------------------------&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(68, 68, 68);"&gt;//READ EXCEL WORKBOOK&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(68, 68, 68);"&gt;//------------------------------&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;          &lt;strong&gt;try&lt;/strong&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;              &lt;strong&gt;while&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Range&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;workSheet&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Cells&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;rowIndex&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;colDateRaised&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value2&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;!&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;                  &lt;span style="color: rgb(32, 64, 160);"&gt;rowIndex&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;2&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;index&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;                  &lt;span style="color: rgb(32, 64, 160);"&gt;DateTime&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;dateRaised&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;DateTime&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;FromOADate&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;double&lt;/strong&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Parse&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Range&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;workSheet&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Cells&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;rowIndex&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;colA&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value2&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                  &lt;span style="color: rgb(32, 64, 160);"&gt;string&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;description&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Excel&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Range&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;workSheet&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Cells&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;[&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;rowIndex&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;colB&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;]&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Value2&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;br /&gt;&lt;br /&gt;                  &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;AppendLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;rowIndex&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;" DateRaised :"&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;dateRaised&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToShortDateString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"Description: "&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;description&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;                    &lt;br /&gt;               &lt;br /&gt;                  &lt;span style="color: rgb(32, 64, 160);"&gt;index&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;          &lt;strong&gt;catch&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Exception&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;ex&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;app&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Quit&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;ex&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Message&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;AppendLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"For more inforamtion please see:"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;AppendLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Path&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"Message:&lt;span style="color: rgb(119, 221, 119);"&gt;\n&lt;/span&gt; "&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: rgb(68, 68, 68);"&gt;//----------------------------&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(68, 68, 68);"&gt;//CREATE OUTLOOK MESSAGE&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(68, 68, 68);"&gt;//------------------------------&lt;/span&gt;&lt;br /&gt; &lt;br /&gt;          &lt;strong&gt;try&lt;/strong&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;// Create the Outlook application by using inline initialization.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Application&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;oApp&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;new&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Application&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;//Create the new message by using the simplest approach.&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;MailItem&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;MailItem&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;oApp&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;CreateItem&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;OlItemType&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;olMailItem&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;//Add a recipient.&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;// TODO: Change the following recipient where appropriate.&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Recipient&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;oRecip&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Recipient&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Recipients&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Add&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"someone@somewhere.com"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oRecip&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Resolve&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;//Set the basic properties.&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Subject&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"Status Update"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Body&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;message&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;ToString&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;//Add an attachment.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;// TODO: change file path where appropriate&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;String&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;sSource&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"C:&lt;span style="color: rgb(119, 221, 119);"&gt;\\&lt;/span&gt;setupxlg.txt"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;String&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;sDisplayName&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;"MyFirstAttachment"&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;iPosition&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Body&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Length&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;+&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;strong&gt;int&lt;/strong&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;iAttachType&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;int&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;OlAttachmentType&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;olByValue&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;Outlook&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Attachment&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;oAttach&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Attachments&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Add&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;sSource&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;iAttachType&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;iPosition&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;sDisplayName&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;// If you want to, display the message.&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;// oMsg.Display(true);  //modal&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;//Send the message.&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Save&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;Send&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;//Explicitly release objects.&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oRecip&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oAttach&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oMsg&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;oApp&lt;/span&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;=&lt;/span&gt; &lt;strong&gt;null&lt;/strong&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(68, 68, 68);"&gt;// Simple error handler.&lt;/span&gt;&lt;br /&gt;          &lt;strong&gt;catch&lt;/strong&gt; &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(32, 64, 160);"&gt;Exception&lt;/span&gt; &lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;              &lt;span style="color: rgb(32, 64, 160);"&gt;Console&lt;/span&gt;.&lt;span style="color: rgb(32, 64, 160);"&gt;WriteLine&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;(&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;"{0} Exception caught: "&lt;/span&gt;, &lt;span style="color: rgb(32, 64, 160);"&gt;e&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;)&lt;/strong&gt;&lt;/span&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;;&lt;/span&gt;&lt;br /&gt;          &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;      &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(68, 68, 255);"&gt;&lt;strong&gt;}&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;This code is based upon examples from the following links:&lt;br /&gt;&lt;br /&gt;Excel:  &lt;a href="http://www.codeproject.com/KB/cs/Excel_Application_in_C_.aspx"&gt;http://www.codeproject.com/KB/cs/Excel_Application_in_C_.aspx&lt;/a&gt;&lt;br /&gt;Outlook: &lt;a href="http://support.microsoft.com/kb/310263"&gt;http://support.microsoft.com/kb/310263&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="outlook"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-2775243050915201654?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/gtATxmvTs3g" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/2775243050915201654/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=2775243050915201654" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2775243050915201654?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2775243050915201654?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/gtATxmvTs3g/read-excel-document-and-send-email-from.html" title="Read an Excel document and Send an email from outlook in c# .net" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2009/01/read-excel-document-and-send-email-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8GQnc9eip7ImA9WxVRFEs.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-2162193742417689587</id><published>2009-01-20T16:04:00.002Z</published><updated>2009-01-20T16:10:23.962Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-20T16:10:23.962Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="clearcase" /><title>Clearcase update from command line showing dialog and windows</title><content type="html">If you like doing things from the command line but you want the update progress bar , etc to pop up, then this is quite useful.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;c:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;cd "C:\Program Files\Rational\ClearCase\bin"&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;"clearviewupdate" -quick -window 1f00f4 -windowmsg c14e -ws &lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;"Path Here"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you don't want the update dialog to pop up you can use:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family: courier new;"&gt;cleartool update &lt;/span&gt;&lt;span style="font-style: italic; font-family: courier new;"&gt;"Path Here"&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-2162193742417689587?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/GEF7ErRoCEU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/2162193742417689587/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=2162193742417689587" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2162193742417689587?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2162193742417689587?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/GEF7ErRoCEU/clearcase-update-from-command-line.html" title="Clearcase update from command line showing dialog and windows" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2009/01/clearcase-update-from-command-line.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4DQXk9eip7ImA9WxVREE4.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-8044965566883150500</id><published>2009-01-15T14:59:00.005Z</published><updated>2009-01-15T15:22:50.762Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-15T15:22:50.762Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="clearcase" /><title>Use Beyond Compare in ClearCase</title><content type="html">If you use any kind of source control system, one of the things you need to do is compare differences or "do diffs" or different versions of a file. However the the compare tool in clearcase is crap.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.scootersoftware.com/"&gt;Beyond Compare&lt;/a&gt; is probably the the best file (and folder) comparison I have come across. It can even compare zip files.&lt;br /&gt;&lt;br /&gt;If you are tired of using the shitty compare tool that is a default in clearcase there is indeed a way to switch this to use beyond compare instead&lt;br /&gt;&lt;br /&gt;1. Go into the "&lt;span style="font-weight: bold;"&gt;C:\Program Files\Rational\ClearCase\lib\mgrs&lt;/span&gt;" directory.&lt;br /&gt;&lt;br /&gt;2. Create a backup of the file named "map".&lt;br /&gt;&lt;br /&gt;3. Edit "&lt;span style="font-weight: bold;"&gt;map&lt;/span&gt;" and change the line:&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;text_file_delta  xcompare   ..\..\bin\cleardiffmrg.exe&lt;/pre&gt;&lt;br /&gt;  to:&lt;br /&gt;&lt;code&gt;&lt;/code&gt;&lt;pre&gt;text_file_delta  xcompare   C:\Progra~1\Beyond~1\bc2.exe&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Thats it, next time you compare two versions of a file in the version tree or you compare with previous version, beyond compare will be used instead.&lt;br /&gt;&lt;br /&gt;Alternately if you want to use &lt;a href="http://winmerge.org/"&gt;winmerge &lt;/a&gt;(which is opensource and free) , then it gives you an option to replace the default viewer when you install it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-8044965566883150500?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/OUpnK807tGw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/8044965566883150500/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=8044965566883150500" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8044965566883150500?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/8044965566883150500?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/OUpnK807tGw/use-beyond-compare-in-clearcase.html" title="Use Beyond Compare in ClearCase" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2009/01/use-beyond-compare-in-clearcase.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUcHSHkyeSp7ImA9WxVREE4.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-2511357110809137875</id><published>2009-01-13T13:03:00.013Z</published><updated>2009-01-15T15:23:59.791Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-01-15T15:23:59.791Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="security" /><title>25 most dangerous programming errors</title><content type="html">A group of software people from various firms brought together by the &lt;a href="http://en.wikipedia.org/wiki/National_Security_Agency"&gt;NSA&lt;/a&gt;  have sat around and come up with a list of the most dangerous 25 programming errors . If you been a developer for more than 5 minutes you have probably come across half of these, but this can be used as a handy checklist.&lt;br /&gt;&lt;br /&gt;In the words of Paul Kurtz, executive director of a group called the Software Assurance Forum for Excellence in Code  "Now, with the Top 25, we can spend less time working with police after the house has been robbed and instead focus on getting locks on the doors before it happens"&lt;br /&gt;&lt;br /&gt;Here's my cheap and cheerful run down of through the list.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Each heading links to the site where there is more detail on each , which includes discussion, prevention and mitagations,  attack patterns against the error.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;15-Jan-08: I haven't had time to comment on each error in the list, but I will do at some point&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt; 1&lt;/span&gt;.  &lt;a href="http://cwe.mitre.org/top25/#CWE-20"&gt;Improper Input Validation&lt;/a&gt;&lt;br /&gt;e.g. Alpha characters aren't allowed to be entered in numeric fields, stuff like that&lt;br /&gt;&lt;span style="font-size:100%;"&gt; 2&lt;/span&gt;. &lt;a href="http://cwe.mitre.org/top25/#CWE-116"&gt;Improper Encoding or Escaping of Output&lt;/a&gt;&lt;br /&gt;Using stored procs and using correct character encoders&lt;br /&gt;3. &lt;a href="http://cwe.mitre.org/top25/#CWE-89"&gt;Failure to Preserve SQL Query Structure (aka 'SQL Injection')&lt;/a&gt;&lt;br /&gt;Make sure a user can't enter sql into a text field that will&lt;br /&gt;4. &lt;a href="http://cwe.mitre.org/top25/#CWE-79"&gt;Failure to Preserve Web Page Structure (aka 'Cross-site Scripting')&lt;/a&gt;&lt;br /&gt;5. &lt;a href="http://cwe.mitre.org/top25/#CWE-78"&gt;Failure to Preserve OS Command Structure (aka 'OS Command Injection')&lt;/a&gt;&lt;br /&gt;6. &lt;a href="http://cwe.mitre.org/top25/#CWE-319"&gt;Cleartext Transmission of Sensitive Information&lt;/a&gt;&lt;br /&gt;7. &lt;a href="http://cwe.mitre.org/top25/#CWE-352"&gt;Cross-Site Request Forgery (CSRF)&lt;/a&gt;&lt;br /&gt;8. &lt;a href="http://cwe.mitre.org/top25/#CWE-362"&gt;Race Condition&lt;/a&gt;&lt;br /&gt;9. &lt;a href="http://cwe.mitre.org/top25/#CWE-209"&gt;Error Message Information Leak&lt;/a&gt;&lt;br /&gt;10. &lt;a href="http://cwe.mitre.org/top25/#CWE-119"&gt;Failure to Constrain Operations within the Bounds of a Memory Buffer&lt;/a&gt;&lt;br /&gt;11. &lt;a href="http://cwe.mitre.org/top25/#CWE-642"&gt;External Control of Critical State Data&lt;/a&gt;&lt;br /&gt;12. &lt;a href="http://cwe.mitre.org/top25/#CWE-73"&gt;External Control of File Name or Path&lt;/a&gt;&lt;br /&gt;13. &lt;a href="http://cwe.mitre.org/top25/#CWE-426"&gt;Untrusted Search Path&lt;/a&gt;&lt;br /&gt;14. &lt;a href="http://cwe.mitre.org/top25/#CWE-94"&gt;Failure to Control Generation of Code (aka 'Code Injection')&lt;/a&gt;&lt;br /&gt;15. &lt;a href="http://cwe.mitre.org/top25/#CWE-494"&gt;Download of Code Without Integrity Check&lt;/a&gt;&lt;br /&gt;16. &lt;a href="http://cwe.mitre.org/top25/#CWE-404"&gt;Improper Resource Shutdown or Release&lt;/a&gt;&lt;br /&gt;17. &lt;a href="http://cwe.mitre.org/top25/#CWE-665"&gt;Improper Initialization&lt;/a&gt;&lt;br /&gt;18. &lt;a href="http://cwe.mitre.org/top25/#CWE-682"&gt;Incorrect Calculation&lt;/a&gt;&lt;br /&gt;19. &lt;a href="http://cwe.mitre.org/top25/#CWE-285"&gt;Improper Access Control (Authorization)&lt;/a&gt;&lt;br /&gt;20.&lt;a href="http://cwe.mitre.org/top25/#CWE-327"&gt; Use of a Broken or Risky Cryptographic Algorithm&lt;/a&gt;&lt;br /&gt;21. &lt;a href="http://cwe.mitre.org/top25/#CWE-259"&gt;Hard-Coded Password&lt;/a&gt;&lt;br /&gt;22. &lt;a href="http://cwe.mitre.org/top25/#CWE-732"&gt;Insecure Permission Assignment for Critical Resource&lt;/a&gt;&lt;br /&gt;23. &lt;a href="http://cwe.mitre.org/top25/#CWE-330"&gt;Use of Insufficiently Random Values&lt;/a&gt;&lt;br /&gt;24.&lt;a href="http://cwe.mitre.org/top25/#CWE-250"&gt; Execution with Unnecessary Privileges&lt;/a&gt;&lt;br /&gt;25. &lt;a href="http://cwe.mitre.org/top25/#CWE-602"&gt;Client-Side Enforcement of Server-Side Security&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-2511357110809137875?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/41hq10bm-Bc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/2511357110809137875/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=2511357110809137875" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2511357110809137875?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2511357110809137875?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/41hq10bm-Bc/25-most-dangerous-programming-errors.html" title="25 most dangerous programming errors" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2009/01/25-most-dangerous-programming-errors.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0EARXkycCp7ImA9WxJaGU0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-694199688634854790</id><published>2009-01-06T08:41:00.005Z</published><updated>2009-08-10T14:07:24.798+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-10T14:07:24.798+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="visual studio" /><title>Remote Debugging a .NET app  with Visual Studio 2008 (9)</title><content type="html">This is where you need to debug an application in visual studio, but the process is running on some other machine (i.e. not on your local box).  A good example is when a tester is running something and you want to connect to their box to debug it.&lt;br /&gt;&lt;br /&gt;This in fact turned out to be a pretty painless process.&lt;br /&gt;&lt;br /&gt;First on the machine where the app is running that you need to debug you need to run &lt;span style="font-weight: bold;"&gt;msvsmon.exe&lt;/span&gt; . I found this in &lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;Program Files&lt;/span&gt;\Microsoft Visual Studio 9.0\Common7\IDE\Remote Debugger\x86 .&lt;br /&gt;&lt;br /&gt;This will bring up the "Visual Studio Remote Debugging Monitor".&lt;br /&gt;&lt;br /&gt;More than likely you will be debugging a machine on your network. So goto &lt;span style="font-weight: bold;"&gt;Tools&gt;Permissions&lt;/span&gt;, and add  the user of the machine where visual studio is running.&lt;br /&gt;&lt;br /&gt;Now run the application you intened to debug&lt;br /&gt;&lt;br /&gt;Now in Visual Studio goto &lt;span style="font-weight: bold;"&gt;Debug&gt;Attach to Process&lt;/span&gt; . In the box "Qualifier" , enter the machine name of where your application is running and hit enter.&lt;br /&gt;&lt;br /&gt;A list of processes will appear in the "Available Processes" box below.  On the other machine in the remote debugging monitor you will see a log that you have connected.&lt;br /&gt;&lt;br /&gt;Select the process which corresponds to the app you want to debug from Available processes and click on attach. And that's it you are now in debug mode and you can set your breakpoints and whatever and debug your app in the usual way!&lt;br /&gt;&lt;br /&gt;For more info look at this article from microsoft :&lt;br /&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/910448"&gt;http://support.microsoft.com/kb/910448&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-694199688634854790?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/49bVtQJ5oRs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/694199688634854790/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=694199688634854790" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/694199688634854790?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/694199688634854790?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/49bVtQJ5oRs/remote-debugging-net-app-with-visual.html" title="Remote Debugging a .NET app  with Visual Studio 2008 (9)" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>3</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2009/01/remote-debugging-net-app-with-visual.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUARHozcCp7ImA9WxRUF0U.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-151834987107500906</id><published>2008-11-27T09:59:00.002Z</published><updated>2008-11-27T10:04:05.488Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-27T10:04:05.488Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="GOS" /><title>Oh my GOS</title><content type="html">What are the f***ing system requirements for &lt;a href="http://www.thinkgos.com/dgadgets.php"&gt;GOS 3&lt;/a&gt; ?&lt;br /&gt;&lt;br /&gt;According to the link above it's x86 1GHZ , 256Mb Ram . But I tried installing this on a laptop that is 2GHz with 256Mb Ram and on the first step of the installer on the live cd (where you select the language) , everything just froze :-(&lt;br /&gt;&lt;br /&gt;If anybody else has had this problem and knows what to do, please leave a comment!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-151834987107500906?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/TKuHfZtT36E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/151834987107500906/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=151834987107500906" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/151834987107500906?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/151834987107500906?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/TKuHfZtT36E/oh-my-gos.html" title="Oh my GOS" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2008/11/oh-my-gos.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQBSH4-cSp7ImA9WxRWEkU.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-5408151783740530810</id><published>2008-10-29T13:21:00.003Z</published><updated>2008-10-29T13:35:59.059Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-29T13:35:59.059Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="sql" /><category scheme="http://www.blogger.com/atom/ns#" term="sqlserver" /><title>SQL Server Cascade Delete</title><content type="html">Just came across one of the most useful scripts ever! It can be a real pain in the arse when you need to delete some data from a table , then find out that some data somewhere else depends upon what you want to delete, and some data somewhere else relies on that, and so on and so on.&lt;br /&gt;&lt;br /&gt;Well this script from &lt;a href="http://www.sqlteam.com/forums/pop_profile.asp?mode=display&amp;amp;id=3203"&gt;Tim Young&lt;/a&gt;,  creates a stored procedure that does everything for you. You just pass it the name of your table and some criteria (like user='bob')  and it will delete all the referencing data and also print out the DELETE statements it created.&lt;br /&gt;&lt;br /&gt;See the link below for a full example and explanation&lt;br /&gt;&lt;a href="http://www.sqlteam.com/article/performing-a-cascade-delete-in-sql-server-7"&gt;http://www.sqlteam.com/article/performing-a-cascade-delete-in-sql-server-7&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But if you can't wait and just want to see the store procedure, here you go&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;&lt;br /&gt;P.S. I got this to work on SQLServer 2005.&lt;br /&gt;&lt;br /&gt;&lt;P&gt;Here’s the code for the procedure:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;font color=Blue&gt;CREATE&lt;/font&gt; &lt;font color=Blue&gt;Procedure&lt;/font&gt; spDeleteRows&lt;br /&gt;&lt;font color=Green&gt;/* &lt;br /&gt;Recursive row delete procedure. &lt;br /&gt;&lt;br /&gt;It deletes all rows in the table specified that conform to the criteria selected, &lt;br /&gt;while also deleting any child/grandchild records and so on.  This is designed to do the &lt;br /&gt;same sort of thing as Access's cascade delete function. It first reads the sysforeignkeys &lt;br /&gt;table to find any child tables, then deletes the soon-to-be orphan records from them using &lt;br /&gt;recursive calls to this procedure. Once all child records are gone, the rows are deleted &lt;br /&gt;from the selected table.   It is designed at this time to be run at the command line. It could &lt;br /&gt;also be used in code, but the printed output will not be available.&lt;br /&gt;*/&lt;/font&gt;&lt;br /&gt; (&lt;br /&gt; @cTableName &lt;font color=Blue&gt;varchar&lt;/font&gt;(50), &lt;font color=Green&gt;/* name of the table where rows are to be deleted */&lt;/font&gt;&lt;br /&gt; @cCriteria &lt;font color=Blue&gt;nvarchar&lt;/font&gt;(1000), &lt;font color=Green&gt;/* criteria used to delete the rows required */&lt;/font&gt;&lt;br /&gt; @iRowsAffected &lt;font color=Blue&gt;int&lt;/font&gt; OUTPUT &lt;font color=Green&gt;/* number of records affected by the delete */&lt;/font&gt;&lt;br /&gt; )&lt;br /&gt;&lt;font color=Blue&gt;As&lt;/font&gt;&lt;br /&gt;&lt;font color=Blue&gt;set&lt;/font&gt; &lt;font color=Blue&gt;nocount&lt;/font&gt; &lt;font color=Blue&gt;on&lt;/font&gt;&lt;br /&gt;&lt;font color=Blue&gt;declare&lt;/font&gt;  @cTab &lt;font color=Blue&gt;varchar&lt;/font&gt;(255), &lt;font color=Green&gt;/* name of the child table */&lt;/font&gt;&lt;br /&gt; @cCol &lt;font color=Blue&gt;varchar&lt;/font&gt;(255), &lt;font color=Green&gt;/* name of the linking field on the child table */&lt;/font&gt;&lt;br /&gt; @cRefTab &lt;font color=Blue&gt;varchar&lt;/font&gt;(255), &lt;font color=Green&gt;/* name of the parent table */&lt;/font&gt;&lt;br /&gt; @cRefCol &lt;font color=Blue&gt;varchar&lt;/font&gt;(255), &lt;font color=Green&gt;/* name of the linking field in the parent table */&lt;/font&gt;&lt;br /&gt; @cFKName &lt;font color=Blue&gt;varchar&lt;/font&gt;(255), &lt;font color=Green&gt;/* name of the foreign key */&lt;/font&gt;&lt;br /&gt; @cSQL &lt;font color=Blue&gt;nvarchar&lt;/font&gt;(1000), &lt;font color=Green&gt;/* query string passed to the sp_ExecuteSQL procedure */&lt;/font&gt;&lt;br /&gt; @cChildCriteria &lt;font color=Blue&gt;nvarchar&lt;/font&gt;(1000), &lt;font color=Green&gt;/* criteria to be used to delete &lt;br /&gt;                                           records from the child table */&lt;/font&gt;&lt;br /&gt; @iChildRows &lt;font color=Blue&gt;int&lt;/font&gt; &lt;font color=Green&gt;/* number of rows deleted from the child table */&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color=Green&gt;/* declare the cursor containing the foreign key constraint information */&lt;/font&gt;&lt;br /&gt;&lt;font color=Blue&gt;DECLARE&lt;/font&gt; cFKey &lt;font color=Blue&gt;CURSOR&lt;/font&gt; LOCAL &lt;font color=Blue&gt;FOR&lt;/font&gt; &lt;br /&gt;&lt;font color=Blue&gt;SELECT&lt;/font&gt; SO1.name &lt;font color=Blue&gt;AS&lt;/font&gt; Tab, &lt;br /&gt;       SC1.name &lt;font color=Blue&gt;AS&lt;/font&gt; Col, &lt;br /&gt;       SO2.name &lt;font color=Blue&gt;AS&lt;/font&gt; RefTab, &lt;br /&gt;       SC2.name &lt;font color=Blue&gt;AS&lt;/font&gt; RefCol, &lt;br /&gt;       FO.name &lt;font color=Blue&gt;AS&lt;/font&gt; FKName&lt;br /&gt;&lt;font color=Blue&gt;FROM&lt;/font&gt; dbo.&lt;font color=Brown&gt;sysforeignkeys&lt;/font&gt; FK  &lt;br /&gt;&lt;font color=Blue&gt;INNER&lt;/font&gt; &lt;font color=Blue&gt;JOIN&lt;/font&gt; dbo.&lt;font color=Brown&gt;syscolumns&lt;/font&gt; SC1 &lt;font color=Blue&gt;ON&lt;/font&gt; FK.fkeyid = SC1.id &lt;br /&gt;                              &lt;font color=Blue&gt;AND&lt;/font&gt; FK.fkey = SC1.colid &lt;br /&gt;&lt;font color=Blue&gt;INNER&lt;/font&gt; &lt;font color=Blue&gt;JOIN&lt;/font&gt; dbo.&lt;font color=Brown&gt;syscolumns&lt;/font&gt; SC2 &lt;font color=Blue&gt;ON&lt;/font&gt; FK.rkeyid = SC2.id &lt;br /&gt;                              &lt;font color=Blue&gt;AND&lt;/font&gt; FK.rkey = SC2.colid &lt;br /&gt;&lt;font color=Blue&gt;INNER&lt;/font&gt; &lt;font color=Blue&gt;JOIN&lt;/font&gt; dbo.&lt;font color=Brown&gt;sysobjects&lt;/font&gt; SO1 &lt;font color=Blue&gt;ON&lt;/font&gt; FK.fkeyid = SO1.id &lt;br /&gt;&lt;font color=Blue&gt;INNER&lt;/font&gt; &lt;font color=Blue&gt;JOIN&lt;/font&gt; dbo.&lt;font color=Brown&gt;sysobjects&lt;/font&gt; SO2 &lt;font color=Blue&gt;ON&lt;/font&gt; FK.rkeyid = SO2.id &lt;br /&gt;&lt;font color=Blue&gt;INNER&lt;/font&gt; &lt;font color=Blue&gt;JOIN&lt;/font&gt; dbo.&lt;font color=Brown&gt;sysobjects&lt;/font&gt; FO &lt;font color=Blue&gt;ON&lt;/font&gt; FK.constid = FO.id&lt;br /&gt;&lt;font color=Blue&gt;WHERE&lt;/font&gt; SO2.Name = @cTableName&lt;br /&gt;&lt;br /&gt;&lt;font color=Blue&gt;OPEN&lt;/font&gt; cFKey&lt;br /&gt;&lt;font color=Blue&gt;FETCH&lt;/font&gt; NEXT &lt;font color=Blue&gt;FROM&lt;/font&gt; cFKey &lt;font color=Blue&gt;INTO&lt;/font&gt; @cTab, @cCol, @cRefTab, @cRefCol, @cFKName&lt;br /&gt;&lt;font color=Blue&gt;WHILE&lt;/font&gt; &lt;font color=Fuchsia&gt;@@FETCH_STATUS&lt;/font&gt; = 0&lt;br /&gt;     &lt;font color=Blue&gt;BEGIN&lt;/font&gt;&lt;br /&gt; &lt;font color=Green&gt;/* build the criteria to delete rows from the child table. As it uses the &lt;br /&gt;           criteria passed to this procedure, it gets progressively larger with &lt;br /&gt;           recursive calls */&lt;/font&gt;&lt;br /&gt; &lt;font color=Blue&gt;SET&lt;/font&gt; @cChildCriteria = @cCol + ' &lt;font color=Blue&gt;in&lt;/font&gt; (&lt;font color=Blue&gt;SELECT&lt;/font&gt; [' + @cRefCol + '] &lt;font color=Blue&gt;FROM&lt;/font&gt; [' + &lt;br /&gt;                              @cRefTab +'] &lt;font color=Blue&gt;WHERE&lt;/font&gt; ' + @cCriteria + ')'&lt;br /&gt; &lt;font color=Blue&gt;print&lt;/font&gt; 'Deleting records &lt;font color=Blue&gt;from&lt;/font&gt; &lt;font color=Blue&gt;table&lt;/font&gt; ' + @cTab&lt;br /&gt; &lt;font color=Green&gt;/* call this procedure to delete the child rows */&lt;/font&gt;&lt;br /&gt; &lt;font color=Blue&gt;EXEC&lt;/font&gt; spDeleteRows @cTab, @cChildCriteria, @iChildRows OUTPUT&lt;br /&gt; &lt;font color=Blue&gt;FETCH&lt;/font&gt; NEXT &lt;font color=Blue&gt;FROM&lt;/font&gt; cFKey &lt;font color=Blue&gt;INTO&lt;/font&gt; @cTab, @cCol, @cRefTab, @cRefCol, @cFKName&lt;br /&gt;     &lt;font color=Blue&gt;END&lt;/font&gt;&lt;br /&gt;&lt;font color=Blue&gt;Close&lt;/font&gt; cFKey&lt;br /&gt;&lt;font color=Blue&gt;DeAllocate&lt;/font&gt; cFKey&lt;br /&gt;&lt;font color=Green&gt;/* finally delete the rows from this table and display the rows affected  */&lt;/font&gt;&lt;br /&gt;&lt;font color=Blue&gt;SET&lt;/font&gt; @cSQL = '&lt;font color=Blue&gt;DELETE&lt;/font&gt; &lt;font color=Blue&gt;FROM&lt;/font&gt; [' + @cTableName + '] &lt;font color=Blue&gt;WHERE&lt;/font&gt; ' + @cCriteria&lt;br /&gt;&lt;font color=Blue&gt;print&lt;/font&gt; @cSQL&lt;br /&gt;&lt;font color=Blue&gt;EXEC&lt;/font&gt; sp_ExecuteSQL @cSQL&lt;br /&gt;&lt;font color=Blue&gt;print&lt;/font&gt; 'Deleted ' + &lt;font color=Fuchsia&gt;CONVERT&lt;/font&gt;(&lt;font color=Blue&gt;varchar&lt;/font&gt;, &lt;font color=Fuchsia&gt;@@ROWCOUNT&lt;/font&gt;) + ' records &lt;font color=Blue&gt;from&lt;/font&gt; &lt;font color=Blue&gt;table&lt;/font&gt; ' + @cTableName&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the above scenario, we were trying to perform the following : &lt;br /&gt;&lt;pre class="code"&gt;    DELETE FROM X WHERE field1 = '234'&lt;/pre&gt;&lt;br /&gt;&lt;P&gt;Using this procedure, we would use the following command:&lt;br /&gt;&lt;pre class="code"&gt;    exec spDeleteRows 'X', 'field1 = ''234''', 0&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-5408151783740530810?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/PTYutqb4ubQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/5408151783740530810/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=5408151783740530810" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/5408151783740530810?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/5408151783740530810?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/PTYutqb4ubQ/sql-server-cascade-delete.html" title="SQL Server Cascade Delete" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>2</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2008/10/sql-server-cascade-delete.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIBQ3oyfCp7ImA9WxdUEkg.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-7389821817794462719</id><published>2008-07-28T13:34:00.007+01:00</published><updated>2008-07-28T15:49:12.494+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-28T15:49:12.494+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="cuil" /><title>Not so warm for cuil</title><content type="html">&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp2.blogger.com/_fh-NK6PsBnw/SI290FqPFtI/AAAAAAAAAE4/MXyGs6fwutA/s1600-h/cuil_screenshot.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5228043445017188050" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://bp2.blogger.com/_fh-NK6PsBnw/SI290FqPFtI/AAAAAAAAAE4/MXyGs6fwutA/s320/cuil_screenshot.jpg" border="0" /&gt;&lt;/a&gt;The&lt;a href="http://news.bbc.co.uk/1/hi/technology/7528503.stm"&gt; top technology story on the bbc&lt;/a&gt; today was a new search "rival" to google. I was going to dismiss it, but I caught the line where it said it is developed by former employees from the big G.&lt;br /&gt;&lt;br /&gt;The name of this new search engine &lt;a href="http://www.cuil.com/"&gt;Cuil &lt;/a&gt;, pronounced Cool means knowledge in Gaelic, but who cares, is it any better than good ol' google?&lt;br /&gt;&lt;br /&gt;First thing I noticed when I entered the site, was the blackness, in contrast to googles white nothingness. Also it took a few moments to come up, I think it may have come up with a loading screen for a second.&lt;br /&gt;&lt;br /&gt;I searched for this blog &lt;a href="http://randomconsultant.blogspot.com/"&gt;randomconsultant&lt;/a&gt; and it didn't have it listed. That was slightly disapointing, as their crawler technology is suppose to be better than google's. But hey it's their first day and this is an little known blog.&lt;br /&gt;&lt;br /&gt;But &lt;a href="http://www.cuil.com/info/"&gt;Cuil does claim that it searches more pages on the web than anyone else &lt;/a&gt;- three times as many as google and ten times as many as microsoft.&lt;br /&gt;&lt;br /&gt;I then searched for something more likely, like the firm I work for. That did come up and the thing that stands out is that the search results were in two columns and each had a little thumbnail. Some of the thumbnails didn't really match the result and there were too many results for pages from the same site.&lt;br /&gt;&lt;br /&gt;On the right it had some categories.. but pratically speaking one wants their search engine to contain what they want in the first 3 hits, who cares about other categories. I remember dogpile.com(use to collect google,yahoo and other searches) had a similar thing but I never used it then.&lt;br /&gt;&lt;br /&gt;The results didn't come up that quickly too, which maybe because the whole web wants to check out a possible google killer. In fact Cuil and cuil.com are number one and two respectively in the hottest &lt;a href="http://www.google.com/trends/hottrends?sa=X"&gt;Google Trends&lt;/a&gt; list (i.e. the most searched for keywords right now) . I am sure google love that.&lt;br /&gt;&lt;br /&gt;The search technology cuil uses is suppose to be a lot more sophicticated than google. Instead of just looking at which pages link to what like google does, it also looks at the context of the page and probably other stuff.&lt;br /&gt;&lt;br /&gt;I will reserve complete judgement for now, until cuil has a bit of time to crawl the web, but I can't see anything now that will really trouble or make me and others want to switch their homepage.&lt;br /&gt;&lt;br /&gt;Maybe in the future, when I am searching for some obscure things and google is firing blanks, and cuil comes up trumps maybe I will switch, but right now I don't think anybody will be in line to jump out of the windows at google hq.&lt;br /&gt;&lt;br /&gt;&lt;span style="FONT-WEIGHT: bold"&gt;STOP PRESS:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Just tried going to &lt;a href="http://www.cuil.com/"&gt;cuil.com&lt;/a&gt; and I got this message&lt;br /&gt;&lt;div id="bdy"&gt;&lt;h2&gt;&lt;/h2&gt;&lt;blockquote&gt;&lt;h2&gt;"We’ll be back soon...&lt;/h2&gt;&lt;p&gt;Due to overwhelming interest, our Cuil servers are running a bit hot right now. The search engine is momentarily unavailable as we add more capacity.&lt;/p&gt;&lt;p&gt;Thanks for your patience."&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;As the US starts waking up looks like they are on overload.... wonder how long people will use it... maybe for the novelty factor... or mayber it will be just "cuiler" (ok that's bad) than googling!&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-7389821817794462719?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/nrUASxSHE3A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/7389821817794462719/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=7389821817794462719" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/7389821817794462719?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/7389821817794462719?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/nrUASxSHE3A/not-so-warm-for-cuil.html" title="Not so warm for cuil" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp2.blogger.com/_fh-NK6PsBnw/SI290FqPFtI/AAAAAAAAAE4/MXyGs6fwutA/s72-c/cuil_screenshot.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2008/07/not-so-warm-for-cuil.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkANR30zeip7ImA9WxdUFE0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-763522993588099422</id><published>2008-07-28T09:42:00.007+01:00</published><updated>2008-07-30T08:59:56.382+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-30T08:59:56.382+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="ilog" /><category scheme="http://www.blogger.com/atom/ns#" term="ibm" /><title>IBM buy ILOG!</title><content type="html">Just heard that IBM have swallowed up another product! Apparently this will provide ILOG customers with &lt;blockquote&gt;"a full set of rule management tools for complete information and application lifecycle management across a comprehensive platform including IBM's leading WebSphere application development and management platform."&lt;/blockquote&gt;&lt;br /&gt;This basically means RSA will probably come bundled with JRules and projects will probably be encouraged (forced) to go with websphere if they choose to go with JRules.&lt;br /&gt;&lt;br /&gt;I just find this quite funny, as for the last couple of years on my project, ILOG have complained websphere is no good, the IBM jdk is no good, and the rule studio plugin doesn't play well with RSA. IBM have complained that JRules has a ton of peformance issues and a whole load of other stuff.&lt;br /&gt;&lt;br /&gt;I wonder what the guys at JBoss think. Before this they were the only ones who could provide a complete suite of application server and rules etc.&lt;br /&gt;&lt;br /&gt;So this will probably bring ILOG into the mainstream, so nowhere is safe from the bpm and brms!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Futher reading:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://smartenoughsystems.com/wp/2008/07/28/first-thoughts-on-the-ibmilog-announcement/"&gt;First thoughts on the IBM/ILOG announcement&lt;/a&gt; by James Taylor - more of an in depth serious look at it than me.&lt;br /&gt;&lt;a href="http://www.onstrategies.com/blog/?p=333"&gt;IBM Puts the Rules Down&lt;/a&gt; - OnStrategies.&lt;br /&gt;&lt;a href="http://www.ilog.com/corporate/releases/us/080728_ibm.cfm"&gt;ILOG Press release&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.theregister.co.uk/2008/07/28/ibm_buys_ilog/"&gt;IBM throws arms around ILOG&lt;/a&gt; - The Register&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-763522993588099422?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/_28gHujkavM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/763522993588099422/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=763522993588099422" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/763522993588099422?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/763522993588099422?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/_28gHujkavM/ibm-buy-ilog.html" title="IBM buy ILOG!" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2008/07/ibm-buy-ilog.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcDSXc-eip7ImA9WxdVFk8.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-2323371610090503385</id><published>2008-07-21T07:55:00.000+01:00</published><updated>2008-07-21T08:57:58.952+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-21T08:57:58.952+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="j2me" /><title>Creating a J2ME app with EclipseME and Sony Ericsson SDK</title><content type="html">I wanted to try out creating a little &lt;a href="http://java.sun.com/javame/index.jsp"&gt;J2ME&lt;/a&gt; application which could be deployed onto my &lt;a href="http://www.sonyericsson.com/cws/products/mobilephones/overview/k850i?cc=us&amp;amp;lc=en"&gt;Sony Ericsson K850i&lt;/a&gt; phone. Sony do provide an SDK, and there seems to be a lot of documentation on their &lt;a href="http://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp"&gt;developer site&lt;/a&gt; , but there wasn't much in the way of a "Hello World" example.&lt;br /&gt;&lt;br /&gt;So this is my example of creating a J2ME application using the EclipseME plugin.&lt;br /&gt;This example should work on similar Sony Ericsson phones.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Prerequisites&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You need to have the following installed before doing anything else:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;JDK 6&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt; 3.2 or above&lt;/li&gt;&lt;li&gt;A Sony Ericsson phone with a USB or bluetooth connection&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.sonyericsson.com/cws/support/softwaredownloads?cc=gb&amp;amp;lc=en"&gt;Sony Ericsson PC Suite&lt;/a&gt; (this should have come on a cd with your phone too)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;First you need to download and install the &lt;a href="http://developer.sonyericsson.com/site/global/docstools/java/p_java.jsp"&gt; Sony Ericsson SDK 2.5.0.2 for the Java(TM) ME Platform &lt;/a&gt;. Install it in the default location which should be "C:\SonyEricsson\JavaME_SDK_CLDC\". Keep a note of this location&lt;br /&gt;&lt;br /&gt;Next you will need to install the EclipseME plugin to Eclipse&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Follow the install instructions from &lt;a href="http://eclipseme.org/docs/installEclipseME.html"&gt;here&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;After you have restarted Eclipse ,you will need to configure EclipseME with Eclipse. Follow the instructions from &lt;a href="http://eclipseme.org/docs/configuring.html"&gt;here&lt;/a&gt; and in step 4 use the location you noted down above(i.e. C:\SonyEricsson\JavaME_SDK_CLDC\) &lt;/li&gt;&lt;/ol&gt;Now you can create a new J2ME Midlet Project. Follow the instructions from &lt;a href="http://eclipseme.org/docs/createProject.html"&gt;here&lt;/a&gt; to do this.&lt;br /&gt;&lt;br /&gt;Now create a new Midlet class following the instructions from &lt;a href="http://eclipseme.org/docs/createMidlet.html"&gt;here&lt;/a&gt; and replace the template code with this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;package com.randomconsultant.test;&lt;br /&gt;&lt;br /&gt;import java.util.Date;&lt;br /&gt;&lt;br /&gt;import javax.microedition.lcdui.Alert;&lt;br /&gt;import javax.microedition.lcdui.Display;&lt;br /&gt;&lt;br /&gt;import javax.microedition.midlet.MIDlet;&lt;br /&gt;import javax.microedition.midlet.MIDletStateChangeException;&lt;br /&gt;&lt;br /&gt;public class MyMidlet extends MIDlet {&lt;br /&gt;&lt;br /&gt;Alert timeAlert;&lt;br /&gt;&lt;br /&gt;public MyMidlet() {&lt;br /&gt;  timeAlert = new Alert("Alert!");&lt;br /&gt;  timeAlert.setString(new Date().toString());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void destroyApp(boolean arg0) throws MIDletStateChangeException {&lt;br /&gt; // TODO Auto-generated method stub&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void pauseApp() {&lt;br /&gt; // TODO Auto-generated method stub&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;protected void startApp() throws MIDletStateChangeException {&lt;br /&gt;  Display.getDisplay(this).setCurrent(timeAlert);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now you can run in debug mode in the phones emulator&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://eclipseme.org/docs/menuDebug.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://eclipseme.org/docs/menuDebug.png" alt="" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_fh-NK6PsBnw/SIQ9XrdcCGI/AAAAAAAAAEw/EiemjMLQTH4/s1600-h/sony_emulator.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_fh-NK6PsBnw/SIQ9XrdcCGI/AAAAAAAAAEw/EiemjMLQTH4/s320/sony_emulator.jpg" alt="" id="BLOGGER_PHOTO_ID_5225368944669100130" border="0" /&gt;&lt;/a&gt;You should see the date pop up for a moment in the emulator.&lt;br /&gt;&lt;br /&gt;Now that we know we have a working app, we can try deploying it onto our phone. You  have to create a package that will create a jad and jar file:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://eclipseme.org/docs/crtpkg.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://eclipseme.org/docs/crtpkg.png" alt="" border="0" /&gt;&lt;/a&gt;The jad and jar file will be dropped into the deployed folder within your project.&lt;br /&gt;&lt;br /&gt;Now connect your phone via the usb cable or using bluetooth and copy the jad and jar file to somewhere on your phone.&lt;br /&gt;&lt;br /&gt;Disconnect your phone from your pc, and open file manager on your phone ( Menu &gt; Organizer &gt; File Manager on my K850i) and select the jad file you copied over. Click on it and it will ask you where you would like to install the jad file (i.e. in applications or games).&lt;br /&gt;&lt;br /&gt;Now your application can be selected from which ever menu you added it to (applications or games) and you will be able to run it!&lt;br /&gt;&lt;br /&gt;For all my source code you can download it from &lt;a href="http://randomconsultant.googlepages.com/MyTestMidlet.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Leave a comment if you can't get this working or need a hand.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-2323371610090503385?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/Af81GsNep8k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/2323371610090503385/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=2323371610090503385" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2323371610090503385?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/2323371610090503385?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/Af81GsNep8k/creating-j2me-app-with-eclipseme-and.html" title="Creating a J2ME app with EclipseME and Sony Ericsson SDK" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp0.blogger.com/_fh-NK6PsBnw/SIQ9XrdcCGI/AAAAAAAAAEw/EiemjMLQTH4/s72-c/sony_emulator.jpg" height="72" width="72" /><thr:total>5</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2008/07/creating-j2me-app-with-eclipseme-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4NQn86fip7ImA9WxdVEU0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-7753213553300536267</id><published>2008-07-12T20:34:00.000+01:00</published><updated>2008-07-15T08:46:33.116+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-15T08:46:33.116+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="drools" /><category scheme="http://www.blogger.com/atom/ns#" term="jrules" /><category scheme="http://www.blogger.com/atom/ns#" term="rule engines" /><title>Working with Drools from a JRules perspective</title><content type="html">I had heard a few good things about &lt;a href="http://www.jboss.org/drools/"&gt;drools&lt;/a&gt; , so I had a play with it over the last few days. I decided to create a small project in &lt;a href="http://www.ilog.com/products/jrules/index.cfm"&gt;JRules 6.7&lt;/a&gt; and keeping the same object model port it to drools 4.07 and see what happens. I specifically wanted to test out porting the following:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;verbalisations&lt;br /&gt;&lt;/li&gt;&lt;li&gt;a ruleflow , with a subflow&lt;/li&gt;&lt;li&gt;business rules (brl rules)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;decision tables&lt;/li&gt;&lt;li&gt;local variables&lt;/li&gt;&lt;/ul&gt;The projects I created can be downloaded from a link at the bottom of this post.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The rule project&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I created a simple JRules project to process a train ticket. Given a journey start point (zone) and a journey destination, the rules would work out the cost of the journey and deduct it from the user's credit on their prepaid card(Oyster card). The price would also be influenced by the type of user (i.e. train staff, student, senior) . I have tried to keep a one-to-one mapping between rules I have created in JRules and rules I created in Drools.&lt;br /&gt;&lt;br /&gt;Download the report of the jrules project from &lt;a href="http://randomconsultant.googlepages.com/jrules_report.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The editors&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;JRules and Drools both provide an editor which is a plugin to eclipse. Actually, using eclipse is the only way to build the rules too. Even if you need to &lt;a href="http://randomconsultant.blogspot.com/2008/07/building-from-command-line-in-jrules-67.html"&gt;build from the command line&lt;/a&gt; , it runs in eclipse headless mode. However in Drools you are not tied to the editor, you can write all you rules in notepad or vi if you want then use the libraries to build them. That said, I would recommend using the eclipse plugin for Drools.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Verbalising the object model&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Firstly if you are unclear about what an object model is in relation to rules, read &lt;a href="http://blogs.ilog.com/brms/2008/07/10/business-object-models/"&gt;Dan Serner's useful entry&lt;/a&gt; on his ILOG blog.&lt;br /&gt;&lt;br /&gt;Ok, JRules , creates your object mapping for free, and creates default verbalisations for your object model. This is great so you can start writing rules right away. However some rules can end up with some convoluted verbalisations as you would have verbalised your object model without thinking about how each one will be used in the rules. You will probably have to go through a verbalisation refactoring stage to sort this out.&lt;br /&gt;&lt;br /&gt;However in Drools, you need to create a dsl (domain specific language) file which maps expressions and actions to some given text. So you first think of your rule, then think of the verbalisation, then you add the mapping to your dsl file. This can lead to rules with greater readability, but you have to add each verbalisation yourself.&lt;br /&gt;&lt;br /&gt;Here's a shot of my dsl file. (btw all the source code can be downloaded from a link at the bottom)&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp0.blogger.com/_fh-NK6PsBnw/SHuWQ6KoFJI/AAAAAAAAAEo/O43rY_o41J0/s1600-h/drools_dsl.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp0.blogger.com/_fh-NK6PsBnw/SHuWQ6KoFJI/AAAAAAAAAEo/O43rY_o41J0/s320/drools_dsl.jpg" alt="" id="BLOGGER_PHOTO_ID_5222933410102121618" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Writing business rules&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ok in Drools you can write rules directly in DRL (equivalent of IRL in JRules) or you can write rules in dslr which use verbalisations (equivalent of BRLs I guess).&lt;br /&gt;&lt;br /&gt;Ok the first thing that threw me, was that you can't use an &lt;code&gt;else&lt;/code&gt; in a rule. Weird huh? But there is probably a good reason for it.  The other thing was, that I found myself getting into an infinite loop in a rule. You need to set the &lt;code&gt;no-loop&lt;/code&gt; property on the rule otherwise it will keep evaluating if the when condition is true.  Otherwise no other great surprises here.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Decision Tables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In JRules, you create decision tables within the eclipse editor. I have always found the Jrules decision table editor a bit flaky and pretty slow to open an existing decision table.&lt;br /&gt;&lt;br /&gt;In Drools, you create decision tables in excel spreadsheets, csv or openoffice spreadsheets. You do not get autocomplete like the JRules editor, and auto static analysis and some other wizzy stuff, but it is very flexible. And given that while I have been working with JRules, I end up importing and exporting everything I do with decision tables to spreadsheets, I found this pretty useful.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ruleflows&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The ruleflow functionality is pretty similar between JRules and Drools. The major exception though is probably that a rule or decision table in Drools points to the rule group(ruleflow task in jrules) it belongs to, rather than in Jrules where a ruleflow task only knows which rules it contains, and a rule can end up in many tasks.&lt;br /&gt;&lt;br /&gt;Actually one of our complaints about JRules was that it was difficult to find out which ruleflows a rule is referenced in. But in Drools as it is the other way round, it is a bit of a hassle to search for all the rules that belong to a group, hopefully in a newer release the editor will automatically show all the rules that  belong to a group.&lt;br /&gt;&lt;br /&gt;Another thing about decision tables in Drools is that individual rows can  belong to different rule groups. In JRules the whole table goes in the task.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Local variables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ok this is where I found the most pain in drools. The equivalent of local variables in drools are global variables. I just couldn't get these damn things to work properly, so I created a local variable class, and a local variable object was passed into the ruleset as a parameter to provide the same functionality. It was also a pain , because I wanted to use a global with a primitive type and drools just didn't like it, and I ended up with some weird errors.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Building and executing&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As I mentioned earlier drools is a bit more flexible as you do not need to use eclipse to build your rules in the same way JRules forces you to do. But in drools you need to add each rule or rule package to your ruleset or Rulebase , in your code. In JRules you just build your jar , and you have all your rules neatly packaged up.  The code to execute the rules in drools is slightly easier than jrules i would say. Look at the code in &lt;code&gt;com.transport.ticketFeeRules.jrules.RuleEngineRunner&lt;/code&gt; and &lt;code&gt;com.transport.OysterCardRules.droolsrulerunner.DroolsRuleRunner&lt;/code&gt; , and you will see the difference.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;The verdict&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I like Drools, but if I was choosing a rules engine at the moment for my project I would stick with JRules. I know Drools is free, but I think it still needs to mature a bit. All the features are there, and it has a web based BRMS too. I have never used JRules Rule Team Server so I didn't compare it to Drools' equivalent.&lt;br /&gt;&lt;br /&gt;In a couple of years though I expect Drools to be a real challenger in this space and as it is opensource I expect a lot more expertise to be out there. So if you have been working with JRules I encourage to try out Drools, but don't expect it to be a replacement just as yet. But if you are going throught the decision process now of picking a rules engine, do not discount Drools, it maybe exactly what you need.&lt;br /&gt;&lt;br /&gt;Download my comparision projects from &lt;a href="http://randomconsultant.googlepages.com/jrules_v_drools.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Related blogs:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://droolsrules.blogspot.com"&gt;Drools Rules&lt;/a&gt; - useful examples on using Drools and benchmarking&lt;br /&gt;&lt;a href="http://blogs.ilog.com/"&gt;ILOG Blogs&lt;/a&gt; - the official blog from the company behind JRules&lt;br /&gt;&lt;a href="http://blog.athico.com/"&gt;Drools&lt;/a&gt; - the blog from the guys who produce Drools&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-7753213553300536267?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/x1UP9yavHB0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/7753213553300536267/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=7753213553300536267" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/7753213553300536267?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/7753213553300536267?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/x1UP9yavHB0/working-with-drools-from-jrules.html" title="Working with Drools from a JRules perspective" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://bp0.blogger.com/_fh-NK6PsBnw/SHuWQ6KoFJI/AAAAAAAAAEo/O43rY_o41J0/s72-c/drools_dsl.jpg" height="72" width="72" /><thr:total>6</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2008/07/working-with-drools-from-jrules.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0cMRnw6fip7ImA9WxdVF0k.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-217799892239195100</id><published>2008-07-08T11:58:00.000+01:00</published><updated>2008-07-22T18:51:27.216+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-22T18:51:27.216+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="jrules" /><title>Building from command line in JRules 6.7</title><content type="html">In my post last week [&lt;a href="http://randomconsultant.blogspot.com/2008/06/2-years-of-jrules.html"&gt;2 years of JRules&lt;/a&gt;] I had a bit of a moan that JRules didn't have out of the box functionality to build a ruleset from outside of eclipse. Ironically a couple of days after I posted that up I was trying out JRules 6.7 and it appears ILOG have pulled their finger out and provided a way of building a ruleset from outside the eclipse rule studio.&lt;br /&gt;&lt;br /&gt;It works by running eclipse in headless mode and providing a script location as one of the command line arguments. The given script is written in javascript and calls the JRules API.&lt;br /&gt;&lt;br /&gt;For those of you who just want to dive straight into the code here are the downloads:&lt;br /&gt;&lt;a href="http://randomconsultant.googlepages.com/rule-builder-script.xml"&gt;&lt;br /&gt;rule-builder-script.xml&lt;/a&gt; - this is an ant build file to run eclipse in headless mode and invoke the script&lt;br /&gt;&lt;br /&gt;&lt;a href="http://randomconsultant.googlepages.com/RulesBuild.js"&gt;RulesBuild.js&lt;/a&gt; - this is the script that builds and extracts a ruleset by calling the JRules API.&lt;br /&gt;&lt;br /&gt;I won't go through the ant script in detail, but if you are new to ant, have a look at the &lt;a href="http://ant.apache.org/manual/"&gt;ant user manua&lt;/a&gt;&lt;a href="http://ant.apache.org/manual/"&gt;l&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The target "BuildSomething" is a dummy target for you to change. Here are the parameters that need to be updated:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;projectName &lt;/span&gt;- This is the name of the project which contains the main rule flow.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;extractorName &lt;/span&gt;- Name of extractor to use&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;archiveFile &lt;/span&gt;- path of where to save the ruleset jar&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;workspace.dir&lt;/span&gt; - path to the eclipse workspace which contains your rule projects&lt;br /&gt;&lt;br /&gt;The other target "buildAndExtractRuleset" which BuildSomething calls, calls the macrodef task "headless.appication" which actually fires up eclipse in headless mode. The variables in here that need to be updated are:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;script.location&lt;/span&gt; - path to RulesBuild.js&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;eclipse.home&lt;/span&gt; - the install path to eclipse&lt;br /&gt;&lt;br /&gt;Once you update these variables you can just run the task BuildSomething (command line:  &lt;code&gt;ant -f rule-builder-script.xml BuildSomething&lt;/code&gt;) .&lt;br /&gt;&lt;br /&gt;The script will take a bit of time to run depending on the number of rules in your projects, and once you see &lt;code&gt;RulesBuild.js ENDED&lt;/code&gt; , your ruleset jar should be in the location of &lt;span style="font-weight: bold;"&gt;archiveFile&lt;/span&gt;.&lt;br /&gt;Now let's look at the script. Firstly get to know the global variables that are accessible in the script:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;tr&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;th&gt;&lt;span style="font-size:85%;"&gt;Global Variable Name&lt;/span&gt;&lt;/th&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;th&gt;&lt;span style="font-size:85%;"&gt;Java Type&lt;/span&gt;&lt;/th&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;th&gt;&lt;span style="font-size:85%;"&gt;Description&lt;/span&gt;&lt;/th&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/tr&gt;&lt;span style="font-size:85%;"&gt;&lt;/span&gt;&lt;tr&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;workspace&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;a href="http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/resources/IWorkspace.html"&gt;&lt;span style="font-size:85%;"&gt;org.eclipse.core.resources.IWorkspace&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Provides access to the projects&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;ruleModel&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;a href="http://www.ilog.com/products/jrules/documentation/jrules67/api/html/ilog/rules/studio/model/IlrRuleModel.html"&gt;&lt;span style="font-size:85%;"&gt;ilog.rules.studio.model.IlrRuleModel&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Provides access to the Rule Studio Model&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;modelHelper&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;a href="http://www.ilog.com/products/jrules/documentation/jrules67/api/html/ilog/rules/studio/javascript/dom/IlrModelHelper.html"&gt;&lt;span style="font-size:85%;"&gt;ilog.rules.studio.javascript.dom.IlrModelHelper&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Modifies to Rule Studio rule model&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;importHelper&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;a href="http://www.ilog.com/products/jrules/documentation/jrules67/api/html/ilog/rules/studio/javascript/dom/IlrImportHelper.html"&gt;&lt;span style="font-size:85%;"&gt;ilog.rules.studio.javascript.dom.IlrImportHelper&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Imports projects into the workspace&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;buildHelper&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;a href="http://www.ilog.com/products/jrules/documentation/jrules67/api/html/ilog/rules/studio/javascript/dom/IlrBuildHelper.html"&gt;&lt;span style="font-size:85%;"&gt;ilog.rules.studio.javascript.dom.IlrBuildHelper&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Builds the projects of the workspace&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;tr&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;extractorHelper&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;a href="http://www.ilog.com/products/jrules/documentation/jrules67/api/html/ilog/rules/studio/javascript/dom/IlrExtractorHelper.html"&gt;&lt;span style="font-size:85%;"&gt;ilog.rules.studio.javascript.dom.IlrExtractorHelper&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;td&gt;&lt;span style="font-size:85%;"&gt;Extracts the ruleset archives from the rule projects&lt;/span&gt;&lt;/td&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/tr&gt;&lt;tr&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;function main()&lt;/span&gt;  is the entry point to the script. This reads in the arguments ,  turns off auto-building , calls the build functions, calls the generate archive action and then prints a report of all the projects built.&lt;br /&gt;&lt;br /&gt;I'll skip to the function build in ArchiveBuilder (line 166):&lt;br /&gt;&lt;br /&gt;First all the projects in the workspace are cleaned and refreshed:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;Utilities.println("Begin Clean...");&lt;br /&gt;buildHelper.clean ();&lt;br /&gt;Utilities.println("End Clean...");&lt;br /&gt;&lt;br /&gt;Utilities.println("Begin Refresh...");&lt;br /&gt;for each( project in workspace.getRoot().getProjects() ) {&lt;br /&gt;project.refreshLocal(2, null);&lt;br /&gt;}&lt;br /&gt;Utilities.println("End Refresh.");&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;You could add some code before this to open projects that are closed in the workspace.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then a full build is called and for each project, a report is generated:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;Utilities.println("Begin Full Build...");&lt;br /&gt;buildHelper.fullBuild();&lt;br /&gt;Utilities.println("End Full Build");&lt;br /&gt;&lt;br /&gt;for each( project in workspace.getRoot().getProjects() ) {&lt;br /&gt;var report = new BuildReport (project,buildHelper.getBuildErrors(project, buildHelper.SEVERITY_ERROR));&lt;br /&gt;this.reports.push (report);&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's the build complete, i.e. the ilr has been created for all your business rules, decision tables, ruleflows, etc.&lt;br /&gt;&lt;br /&gt;Now all this ilr has to be packaged up into a jar.&lt;br /&gt;&lt;br /&gt;The &lt;span style="font-weight: bold;"&gt;generate &lt;/span&gt; function(line 192) is called to to this.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;var rp = ruleModel.getRuleProject(ruleprojectName) ;&lt;br /&gt;var jarfile = archivePath;&lt;br /&gt;Utilities.println("Extracting ruleset archive " + rp.getName() + " with extractor '" + extractor + "'");&lt;br /&gt;extractorHelper.extract(rp,jarfile,extractor);&lt;br /&gt;Utilities.println("Successfully extracted in " + (new java.io.File (jarfile)).getAbsolutePath());&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;The extractorHelper is called to extract the jar. If you don't have an extractor, the extract method is overloaded to also generate a ruleset just with a RuleProject and a path location.&lt;br /&gt;&lt;br /&gt;That's about it. I really advise you to go through the &lt;a href="http://randomconsultant.googlepages.com/RulesBuild.js"&gt;RulesBuild.js&lt;/a&gt; and look at the JRules API documentation. If you have any questions post me a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-217799892239195100?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/DKCnw9zgwzU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/217799892239195100/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=217799892239195100" title="21 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/217799892239195100?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/217799892239195100?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/DKCnw9zgwzU/building-from-command-line-in-jrules-67.html" title="Building from command line in JRules 6.7" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>21</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2008/07/building-from-command-line-in-jrules-67.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIGRHs_eCp7ImA9WxdVGU0.&quot;"><id>tag:blogger.com,1999:blog-5599902997355913399.post-614480034977650797</id><published>2008-07-02T12:10:00.001+01:00</published><updated>2008-07-24T15:08:45.540+01:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-24T15:08:45.540+01:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="vb" /><category scheme="http://www.blogger.com/atom/ns#" term="vba" /><category scheme="http://www.blogger.com/atom/ns#" term="clearquest" /><title>Using ClearQuest API from VB 6 or VBA</title><content type="html">On my current project, I found myself exporting my team's list of activities from &lt;a href="http://www.ibm.com/software/awdtools/clearquest"&gt;clearquest&lt;/a&gt; to excel over and over again. This made me look at what &lt;a href="http://www.ibm.com/software/awdtools/clearquest"&gt;clearquest&lt;/a&gt; offers in terms of an API. Luckily enough, there was an API available, however whatever documentation that google threw at me, was pants.&lt;br /&gt;&lt;br /&gt;I created an excel VBA macro to connect to clearquest and pull whatever data I wanted. Another useful use of the API is wto create some kind of integration tool thing between &lt;a href="http://subversion.tigris.org/"&gt;subversion&lt;/a&gt; and clearquest. I haven't had time to do this though.&lt;br /&gt;&lt;br /&gt;You can download the excel workbook which contains my vba macro from &lt;a href="http://randomconsultant.googlepages.com/cq2excel.xls"&gt;here&lt;/a&gt;. You need access to a clearquest database and have the clearquest client installed for this to work.&lt;br /&gt;&lt;br /&gt;Here's an explanation of the code which is contained in the "ThisWorkbook" object if you open the Visual Basic editor ( Tools &gt; Macro &gt; Visual Basic Editor) .&lt;br /&gt;&lt;br /&gt;I would recommend that you have the &lt;a href="http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearquest.apiref.doc/default_topic.htm"&gt;Rational ClearQuest API Reference&lt;/a&gt; open while you're going through this.&lt;br /&gt;&lt;br /&gt;The first thing to do is to import the module clearquest.bas from C:\Program Files\Rational\Clearquest or wherever cq is installed. This module contains a whole load of useful contstants that you may need later on.&lt;br /&gt;&lt;br /&gt;Next open Tools&gt;References and look in the Available references list and make sure "ClearQuestOLEServer" is selected.&lt;br /&gt;&lt;br /&gt;Now for some code. You need to create a Session object to connect to clearquest. You need to supply a username, password and name of the clearquest database you are connecting to&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;'LOGIN - Create CQ Session&lt;br /&gt;'==========================&lt;br /&gt;Dim cqsession As Session&lt;br /&gt;Set cqsession = New Session&lt;br /&gt;&lt;br /&gt;Call cqsession.UserLogon(strUsername, strPassword, strCQDB, AD_SHARED_SESSION, "")&lt;/code&gt;&lt;/pre&gt;&lt;code&gt;'Create Query&lt;br /&gt;'===============&lt;br /&gt;Set querydef = cqsession.BuildQuery(strRecordType)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;'Fields to display&lt;br /&gt;For Each displayField In displayFields&lt;br /&gt;querydef.BuildField (displayField)&lt;br /&gt;Next displayField&lt;/code&gt;&lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;br /&gt;displayFields is simly an array of strings where each string is a name of a field.&lt;br /&gt;&lt;br /&gt;Next the filters for the query need to be added.&lt;br /&gt;This creates an AND operator (the constant &lt;code&gt;AD_BOOL_OP_AND&lt;/code&gt; is from the module that was imported)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;Set Operator = querydef.BuildFilterOperator(AD_BOOL_OP_AND)&lt;/code&gt;&lt;/pre&gt;This filter added below specifies that the value of the given field (strFieldFilterName) must be one of the values in the array filterValues&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;Call Operator.BuildFilter(strFilterFieldName, AD_COMP_OP_IN, filterValues)&lt;/code&gt;&lt;/pre&gt;Now you can execute your query and get back some results&lt;br /&gt;&lt;br /&gt;This creates and populats a ResultSet object from the query&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;Dim rsltset As Object&lt;br /&gt;Set rsltset = cqsession.BuildResultSet(querydef)&lt;br /&gt;Call rsltset.Execute&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Now you can iterate through &lt;code&gt;rsltset&lt;/code&gt; using &lt;code&gt;rsltset.MoveNext&lt;/code&gt; and calling &lt;code&gt;rsltset.GetColumnValue(Column)&lt;/code&gt; to get the values.&lt;br /&gt;&lt;br /&gt;At the end call &lt;code&gt;cqsession.SignOff&lt;/code&gt; so it closes the clearquest session cleanly.&lt;br /&gt;&lt;br /&gt;That's it. Looking at the example in the workbook you should be able to create and execute your own queries. This will work in VB 6 too.&lt;br /&gt;&lt;br /&gt;The source code for everything here can be downloaded from &lt;a href="http://randomconsultant.googlepages.com/cq2excel.xls"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you just want the code without downloading the excel workbook , download from &lt;a href="http://randomconsultant.googlepages.com/ThisWorkbook.cls"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Further reading:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://publib.boulder.ibm.com/infocenter/cqhelp/v7r0m0/index.jsp?topic=/com.ibm.rational.clearquest.apiref.doc/default_topic.htm"&gt;Rational ClearQuest API Reference&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5599902997355913399-614480034977650797?l=randomconsultant.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/RandomConsultant/~4/mO7o9MpRU_c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://randomconsultant.blogspot.com/feeds/614480034977650797/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=5599902997355913399&amp;postID=614480034977650797" title="19 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/614480034977650797?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/5599902997355913399/posts/default/614480034977650797?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/RandomConsultant/~3/mO7o9MpRU_c/using-clearquest-api-from-vb-6-or-vba.html" title="Using ClearQuest API from VB 6 or VBA" /><author><name>SM</name><uri>http://www.blogger.com/profile/12739561458581174311</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="21" src="http://4.bp.blogspot.com/_fh-NK6PsBnw/TLiBpqCHOyI/AAAAAAAAAQQ/9XeZDkBL3Mo/s1600-R/blue_screen_of_death.gif" /></author><thr:total>19</thr:total><feedburner:origLink>http://randomconsultant.blogspot.com/2008/07/using-clearquest-api-from-vb-6-or-vba.html</feedburner:origLink></entry></feed>

