<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jeff Widmer's Blog</title><link>http://weblogs.asp.net/jeffwids/default.aspx</link><description>ASP.NET, ASP.NET MVC, C#, VB.NET, IIS7, Windows Forms, VB6, ASP 3.0</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>How to show white space in Visual Studio</title><link>http://weblogs.asp.net/jeffwids/archive/2009/11/11/how-to-show-white-space-in-visual-studio.aspx</link><pubDate>Thu, 12 Nov 2009 02:19:42 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7251964</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7251964</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7251964</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/11/11/how-to-show-white-space-in-visual-studio.aspx#comments</comments><description>&lt;p&gt;In Microsoft Word I usually have the paragraph symbol turned on to Show Hidden Formatting Symbols (white space) so that I can clearly see spaces, tabs, and other white space characters.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_06C0FC06.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_6D58F8CB.png" width="36" height="36" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_312D2D23.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_3E270D34.png" width="260" height="211" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Up until recently I had no idea that Visual Studio had the same option to display white space.&amp;#160; Jeff Atwood’s recent blog post &lt;a href="http://www.codinghorror.com/blog/archives/001310.html"&gt;Whitespace: The Silent Killer&lt;/a&gt; had a screen shot on some code showing white space characters, so I hunted around in the Visual Studio toolbars for a little bit and found the option under the Edit menu.&lt;/p&gt;  &lt;p&gt;Edit &amp;gt; Advanced &amp;gt; View White Space &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_7CAC5ADA.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_7C4027E5.png" width="305" height="37" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_626BF1B6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_5AE08249.png" width="234" height="216" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can also use Ctrl+R, Ctrl+W to toggle it on and off.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:58cf2cbf-73d4-43f8-ad2c-3fa2b265ec01" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Visual+Studio" rel="tag"&gt;Visual Studio&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Visual+Studio+Tips+and+Tricks" rel="tag"&gt;Visual Studio Tips and Tricks&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7251964" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Tips+_2600_+Tricks/default.aspx">Tips &amp; Tricks</category></item><item><title>ISO 3166-1 Country Data SQL Script</title><link>http://weblogs.asp.net/jeffwids/archive/2009/11/09/iso-3166-1-country-data-sql-script.aspx</link><pubDate>Tue, 10 Nov 2009 02:15:08 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7250207</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7250207</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7250207</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/11/09/iso-3166-1-country-data-sql-script.aspx#comments</comments><description>&lt;p&gt;I am creating a standard sign up form with one of the fields being a country drop down. So I created my Country database table and then needed to fill it with information. I found the &lt;a href="http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm"&gt;ISO list of countries here&lt;/a&gt;, but then the issue was how to get that list into my Country database table. Luckily someone has already done that for me: &lt;a href="http://vidmar.net/weblog/archive/2008/05/23/database-of-country-names-numeric-alpha-2-and-alpha-3-iso-codes.aspx"&gt;http://vidmar.net/weblog/archive/2008/05/23/database-of-country-names-numeric-alpha-2-and-alpha-3-iso-codes.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;But I also like to be able to check a script like that into source control to be able to track changes to it. So I updated the insert script to be a rerunnable insert/update script.&amp;#160; The script will check if a country id exists and if it does not exist, then it will insert the country otherwise it will just do an update. The insert sql script from &lt;a href="http://vidmar.net/weblog/archive/2008/05/23/database-of-country-names-numeric-alpha-2-and-alpha-3-iso-codes.aspx"&gt;http://vidmar.net/weblog/archive/2008/05/23/database-of-country-names-numeric-alpha-2-and-alpha-3-iso-codes.aspx&lt;/a&gt; really got me most of the way there so I need to give a lot of credit to him.&lt;/p&gt;  &lt;p&gt;The link below will get you my updated version of the country data update sql script. I also updated it to 2009 from the &lt;a href="http://www.iso.org/iso/country_codes/iso_3166_code_lists.htm"&gt;ISO 3166 code lists&lt;/a&gt; plus any changes that they have posted so it is up to date as of November 9, 2009. I will try (but no promises) to keep it updated on a regular basis. Feel free to contact me if you want to try and keep it updated for me and I will post it here.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;font color="#000080" size="3" face="Courier New"&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/CountryScript/Country.sql.zip"&gt;Click here for the country data update sql script (updated as of November 9, 2009).&lt;/a&gt;&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;You can use this sql to create the Country table:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;CREATE TABLE [dbo].[Country]        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; (        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CountryId int NOT NULL,        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Iso2 char(2) NOT NULL,        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Iso3 char(3) NOT NULL,        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Name nvarchar(64) NOT NULL,        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DateCreated datetimeoffset(7) NOT NULL CONSTRAINT [df__Country__DateCreated] DEFAULT (sysdatetimeoffset()),        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; DateModified datetimeoffset(7) NOT NULL&amp;#160; CONSTRAINT [df__Country__DateModified] DEFAULT (sysdatetimeoffset())        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; )&amp;#160; &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;ALTER TABLE dbo.Country ADD CONSTRAINT       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; pk__Country__CountryId PRIMARY KEY CLUSTERED        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; (        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; CountryId ASC        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ) WITH FILLFACTOR = 100 ON [PRIMARY]&lt;/font&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:aec12823-72bf-435c-93fb-b412b6680ea3" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ISO+3166+Country+Codes" rel="tag"&gt;ISO 3166 Country Codes&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SQL+Scripts" rel="tag"&gt;SQL Scripts&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7250207" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/SQL+Script/default.aspx">SQL Script</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/SQL/default.aspx">SQL</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/ISO+Country+Codes/default.aspx">ISO Country Codes</category></item><item><title>Generating a random strong password</title><link>http://weblogs.asp.net/jeffwids/archive/2009/11/07/generating-a-random-strong-password.aspx</link><pubDate>Sun, 08 Nov 2009 02:40:08 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7249084</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7249084</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7249084</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/11/07/generating-a-random-strong-password.aspx#comments</comments><description>&lt;p&gt;You can use the ASP.NET Membership provider to generate a new random strong password.&lt;/p&gt;  &lt;p&gt;In the past I have usually either rolled my own authentication system or integrated an asp.net authentication system into an existing application and therefore I did not use the ASP.NET Membership system.&amp;#160; In the current application I am writing, I had a need to generate a random strong password for the customer.&amp;#160; &lt;/p&gt;  &lt;p&gt;The ASP.NET Membership system already has a static method built-in for this.&amp;#160; You can use the GeneratePassword static method from the Membership class to create a new password:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;String strongPassword = System.Web.Security.Membership.GeneratePassword(8, 1);&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;From the MSDN documentation, the two parameters are:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;length – Int32&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;The number of characters in the generated password. The length must be between 1 and 128 characters. &lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;numberOfNonAlphanumericCharacters – Int32&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;The minimum number of punctuation characters in the generated password. &lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;p&gt;Also from the documentation: the generated password will contain alphanumeric characters and the following punctuation marks: !@#$%^&amp;amp;*()_-+=[{]};:&amp;lt;&amp;gt;|./?. &lt;/p&gt;  &lt;p&gt;But also not included in the documentation is that the returned password will not be a “dangerous string”; in other words it won’t look like a block of script.&amp;#160; &lt;/p&gt;  &lt;p&gt;The Membership.GeneratePassword checks the newly generated password string using an internal method called CrossSiteScriptingValidation.IsDangerousString() and will not return a password that does not pass this test.&amp;#160; It will just loop and continue to generate a new one until it is not considered a dangerous string.&amp;#160; Pretty cool stuff!&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1a834046-33da-4c3f-9a51-87e964e9d9ec" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ASP.NET+Membership" rel="tag"&gt;ASP.NET Membership&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Generate+Password" rel="tag"&gt;Generate Password&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C%23" rel="tag"&gt;C#&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7249084" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/ASP.NET+Membership/default.aspx">ASP.NET Membership</category></item><item><title>Canon Scanner – Unable to open TWAIN source</title><link>http://weblogs.asp.net/jeffwids/archive/2009/11/02/canon-scanner-unable-to-open-twain-source.aspx</link><pubDate>Tue, 03 Nov 2009 04:49:07 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7245680</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7245680</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7245680</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/11/02/canon-scanner-unable-to-open-twain-source.aspx#comments</comments><description>&lt;p&gt;I have a Canon CanoScan 4400F Scanner and the other day I was unable to get it to work.&amp;#160; I use the Canon software CanoScan Toolbox to operate the scanner and when trying to scan I was getting the following error message:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_3B160AED.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_08460479.png" width="244" height="160" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;---------------------------   &lt;br /&gt;CanoScan Toolbox    &lt;br /&gt;---------------------------    &lt;br /&gt;Unable to open TWAIN source    &lt;br /&gt;Please check connection    &lt;br /&gt;Then re-start Toolbox    &lt;br /&gt;---------------------------    &lt;br /&gt;OK&amp;#160;&amp;#160; &lt;br /&gt;---------------------------&lt;/p&gt;  &lt;p&gt;Searching the Internet for this problem turned up several people having the same problem and several solutions which looked like they may or may not work.&amp;#160; One of the recommended solutions was to make sure a certain folder path is in your PATH environment variable.&amp;#160; As it turned out this was the problem, so here is how to add that path back into your environment variables.&lt;/p&gt;  &lt;p&gt;First, determine the correct path to add into the PATH environment variable.&amp;#160; Look in C:\Windows\twain_32 and there should one other folder in there.&amp;#160; In my case it was&amp;#160; named CNQ4803. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_727C1C1B.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_667A2BE7.png" width="244" height="169" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This is the path that is needed to be added into the PATH environment variable. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;C:\Windows\twain_32\CNQ4803&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now, follow these instructions to get to the dialog to modify the PATH environment variable.&lt;/p&gt;  &lt;p&gt;Control Panel &amp;gt; System &amp;gt; and then choose Advanced System Settings in the left hand column.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_2975FA55.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_2FBCD0E3.png" width="244" height="158" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;This will bring up the System Properties dialog (it should already be on the Advanced tab).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_4E9344C1.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_7B3BFE9A.png" width="325" height="368" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;At the bottom of this dialog is an Environment Variables button.&amp;#160; Clicking this button will bring up the Environment Variables dialog.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_19A63F84.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_3F9BEFDA.png" width="296" height="324" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the bottom panel, scroll until you find the variable named Path.&amp;#160; Select this one and then hit the Edit… button to bring up the Edit System Variable dialog.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_5E0630C3.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_288D6E9E.png" width="322" height="139" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the Variable value text box, scroll all the way to the right and then add in the path C:\Windows\twain_32\CNQ4803 that was determined earlier.&amp;#160; Make sure to separate this value with a preceding semi-colon.&amp;#160; And also be careful not to make any other changes to this value.&lt;/p&gt;  &lt;p&gt;Now OK your way out of all of the dialogs and CanoScan Toolbox will now work as expected.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:dfea7d6b-d71a-444f-99fb-fad3b41d4bb0" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Canon+Scanner+CanoScan+Toolbox" rel="tag"&gt;Canon Scanner CanoScan Toolbox&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Environment+Variables" rel="tag"&gt;Environment Variables&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7245680" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Canon+Scanner+CanoScan+Toolbox/default.aspx">Canon Scanner CanoScan Toolbox</category></item><item><title>Machine Setup: Turn-off clicking sound when browsing folders</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/31/machine-setup-turn-off-clicking-sound-when-browsing-folders.aspx</link><pubDate>Sat, 31 Oct 2009 15:04:13 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7243910</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7243910</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7243910</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/31/machine-setup-turn-off-clicking-sound-when-browsing-folders.aspx#comments</comments><description>&lt;p&gt;In the past I usually have had the sound turned off on my computer but recently I have been leaving it on.&amp;#160; With the sound on, browsing folders in Explorer or navigating in Internet Explorer would play a clicking sound whenever changing folders or navigating to a new page.&amp;#160; That gets annoying very quickly so here is how I shut it off on Windows Server 2008 (and probably Windows Vista too):&lt;/p&gt;  &lt;p&gt;Start &amp;gt; Control Panel &amp;gt; Sound&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_4BB10AAC.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_63D47507.png" width="65" height="83" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;In the Sound Control Panel, select the Sounds tab and then in the Program panel scroll all the way down to the “Windows Explorer” program (it will be near the bottom).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_1F27DAC6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_3DFE4EA4.png" width="340" height="379" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Under the Windows Explorer program is a “Start Navigation” sound:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_1513399B.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_4DBDE3A8.png" width="212" height="30" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Select this one (you can use the Test Button to confirm that you have the correct sound) and then change the Sounds dropdown near the bottom to “(None)”.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_06688DB6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_73B393FE.png" width="305" height="173" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Hit Apply and OK your way ok of the Sound Control Panel and now no more clicking sound while browsing folders in Explorer or while navigating in Internet Explorer.&lt;/p&gt;  &lt;p&gt;This is getting added to my Machine Setup checklist for when I rebuild my development environment.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5e3a1a3e-22cc-444e-8a39-1165410eda07" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Windows+Server+2008+Sounds" rel="tag"&gt;Windows Server 2008 Sounds&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Machine+Setup" rel="tag"&gt;Machine Setup&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7243910" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Machine+Setup/default.aspx">Machine Setup</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Windows+Server+2008/default.aspx">Windows Server 2008</category></item><item><title>How to quickly comment or uncomment lines of code in Visual Studio</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/27/how-to-quickly-comment-or-uncomment-lines-of-code-in-visual-studio.aspx</link><pubDate>Wed, 28 Oct 2009 02:37:48 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7241088</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7241088</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7241088</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/27/how-to-quickly-comment-or-uncomment-lines-of-code-in-visual-studio.aspx#comments</comments><description>&lt;p&gt;When I am developing I am always trying to reduce the amount of time that my hands come off of the keyboard and have to move to the mouse.&amp;#160; One of the frequent functions that I noticed required me to move my hand off of the keyboard to the mouse is commenting or uncommenting lines of code.&lt;/p&gt;  &lt;p&gt;Visual Studio has two buttons in the toolbar to comment or uncomment a line of code (they are part of the Text Editor or HTML Source Editing Toolbars):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_602287FC.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_743BA485.png" width="55" height="33" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can also achieve the same result by using the key combination Ctrl-K, Ctrl-C to comment out the currently selected lines or Ctrl-K, Ctrl-U to uncomment the currently selected lines.&amp;#160; &lt;/p&gt;  &lt;p&gt;Ctrl-K, Ctrl-C means to hold down the Control key and then press K and then while still holding down the Control key press C.&amp;#160; Ctrl-K, Ctrl-U means to hold down the Control key and then press K and then while still holding down the Control key press U.&lt;/p&gt;  &lt;p&gt;I have found this key combination to be difficult at first to remember (in the past I tended to always just instinctively go for my mouse) but now I have remembered to use that key combination regularly and have found it very helpful.&amp;#160; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c7758de4-2313-43c7-89ed-85d135d78d07" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Visual+Studio" rel="tag"&gt;Visual Studio&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Comment+Lines+of+Code" rel="tag"&gt;Comment Lines of Code&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Uncomment+Lines+of+Code" rel="tag"&gt;Uncomment Lines of Code&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7241088" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Tips+_2600_+Tricks/default.aspx">Tips &amp; Tricks</category></item><item><title>How to send email when port 25 is blocked</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/27/how-to-send-email-when-port-25-is-blocked.aspx</link><pubDate>Tue, 27 Oct 2009 04:28:10 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7240163</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7240163</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7240163</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/27/how-to-send-email-when-port-25-is-blocked.aspx#comments</comments><description>&lt;p&gt;I run Windows Server 2008 as my development environment and use the local SMTP service to send emails for any website or application that I am developing and that needs to send email.&amp;#160; Recently I was working on a Billing Application that needed to send emails and I wanted to send several to myself for testing, but for some reason the emails were not being sent.&lt;/p&gt;  &lt;p&gt;I followed this &lt;a href="http://weblogs.asp.net/owscott/archive/2005/03/15/Troubleshooting-email_2C00_-the-Telnet-way.aspx"&gt;article from Scott Forsyth about how to debug smtp issues&lt;/a&gt;.&amp;#160; After connecting using Telnet and manually sending a message, I saw the email message sitting there in my queue (C:\inetpub\mailroot\Queue) and not going out. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_0EB3D7DF.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_5B779E75.png" width="266" height="178" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Next I checked the event log and found this message (I was sending to a gmail account for testing):&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;Message delivery to the host 'XXX.XX.XXX.XX' failed while delivering to the remote domain 'gmail.com' for the following reason: The remote server did not respond to a connection attempt.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This indicated that my local smtp server was not able to connect to gmail’s mail server.&amp;#160; I use Verizon Residential DSL as my Internet Service Provider (ISP).&amp;#160; Some time in 2009, Verizon Residential DSL began blocking port 25.&amp;#160; This caused my local development machine SMTP server to not be able to send email.&lt;/p&gt;  &lt;p&gt;An easy workaround that I found was to send using my Verizon DSL email account.&amp;#160; To do this you need to specify port 587 and also your credentials for your Verizon account:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;System.Net.Mail.SmtpClient smtpClient = null; &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;smtpClient = new System.Net.Mail.SmtpClient(&amp;quot;outgoing.verizon.net&amp;quot;, 587);&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;smtpClient.Credentials = new System.Net.NetworkCredential(&amp;quot;&lt;em&gt;account&lt;/em&gt;@verizon.net&amp;quot;, &amp;quot;password&amp;quot;);&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font face="Courier New"&gt;smtpClient.Send(m); &lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Verizon lets you create multiple email accounts so it was easy to create a secondary account just for me to send through instead of using my primary account.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:b1d730a0-cf3e-4389-a7ef-2fe617db47a7" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Verizon+Residential+DSL" rel="tag"&gt;Verizon Residential DSL&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Smtp+Client" rel="tag"&gt;Smtp Client&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7240163" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/SMTP/default.aspx">SMTP</category></item><item><title>Machine Setup: How to enable Line Numbers in Visual Studio and SQL Server Management Studio</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/23/machine-setup-how-to-enable-line-numbers-in-visual-studio-and-sql-server-management-studio.aspx</link><pubDate>Sat, 24 Oct 2009 01:16:11 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7237531</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7237531</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7237531</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/23/machine-setup-how-to-enable-line-numbers-in-visual-studio-and-sql-server-management-studio.aspx#comments</comments><description>&lt;p&gt;I like to have line numbers visible when working in both Visual Studio and SQL Server Management Studio.&amp;#160; By default, line numbers are turned off in both environments.&amp;#160; One of the first things I do when setting up a new development machine is to open Visual Studio and SQL Server Management Studio, enable line numbers, and then close both of them so that the setting is saved for the future.&lt;/p&gt;  &lt;p&gt;In Microsoft Visual Studio, to enable line numbers open the Options dialog by going to Tools &amp;gt; Options…   &lt;br /&gt;Then expand the Text Editor node and then the All Languages node.&amp;#160; Now you will see a Line Number checkbox under the Display section on the right-hand side.&amp;#160;&amp;#160; Check this box to display line numbers.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_15FE9D0F.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_4C8C4853.png" width="450" height="260" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;It is a nearly identical procedure to enable line numbers in Microsoft SQL Server Management Studio:   &lt;br /&gt;Tools &amp;gt; Options… &amp;gt; Text Editor &amp;gt; All Languages &amp;gt; Line Numbers checkbox&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_4ADB7C7F.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_0F3B6DBF.png" width="450" height="260" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:35139347-3930-45e7-bc7d-261aa0c7e5f6" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Visual+Studio" rel="tag"&gt;Visual Studio&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SQL+Server+Management+Studio" rel="tag"&gt;SQL Server Management Studio&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7237531" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Machine+Setup/default.aspx">Machine Setup</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/SQL+Server+Management+Studio/default.aspx">SQL Server Management Studio</category></item><item><title>How to quickly format a C# class file – Ctrl-K, Ctrl-D</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/21/how-to-quickly-format-a-c-class-file-ctrl-k-ctrl-d.aspx</link><pubDate>Thu, 22 Oct 2009 00:57:41 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7235421</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7235421</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7235421</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/21/how-to-quickly-format-a-c-class-file-ctrl-k-ctrl-d.aspx#comments</comments><description>&lt;p&gt;In C# as you are typing in a class file the indenting of your code can easily get out of alignment making the code hard to read.&amp;#160; Where does your class, if block, or method begin and end??&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_6D0D1430.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_331DD144.png" width="337" height="326" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You can manually go and fix each line but there is a much simpler way to correct the indenting.&amp;#160; You can use Ctrl-K, Ctrl-D to format the entire document.&amp;#160; Now your code will be reformatted to the correct indenting for your page.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_388C41E8.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_777DC283.png" width="341" height="330" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Couple things to note:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;If there are errors in the structure of your code (missing closing brackets, missing semi-colon, etc.) then this will not work.&amp;#160; This will still work with other errors such as undeclared variables.&lt;/li&gt;    &lt;li&gt;If you are working on legacy code (for example fixing a bug) and there is a different indenting structure, it is good practice to stick with the legacy indenting and not modify the indenting of the entire file just because you fixed a bug in one line of code.&amp;#160; You should try to minimize your code change to only what was necessary to fix the bug (don’t reformat the entire file).&amp;#160; The next person that does a diff on your check-in with the previous check-in will thank you.&lt;/li&gt;    &lt;li&gt;I also leave the Visual Studio indentation settings alone and stick with the defaults.&amp;#160; If you have a different indentation style than a code file that was previously checked, this process could also cause the subsequent diff to show lots of red.&amp;#160; &lt;/li&gt;    &lt;li&gt;You can use Ctrl-K, Ctrl-F on smaller blocks of text, so if you have a strange indenting style then highlighting only your change can correct the indentation on the selected lines and not the entire file.&lt;/li&gt;    &lt;li&gt;These can be found under the Edit &amp;gt; Advanced Menu:&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_67FAB0B4.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_678E7DBF.png" width="283" height="53" /&gt;&lt;/a&gt; &lt;/li&gt;   &lt;/ul&gt;    &lt;li&gt;Cutting and Pasting is also another way to get the content formatted quickly:&lt;/li&gt;    &lt;ul&gt;     &lt;li&gt;Ctrl-A, Ctrl-X, Ctrl-V&lt;/li&gt;   &lt;/ul&gt; &lt;/ul&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2861b0ea-a8aa-41cd-a2fa-3f57db37bf35" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Visual+Studio+Tip+and+Tricks" rel="tag"&gt;Visual Studio Tip and Tricks&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7235421" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Tips+_2600_+Tricks/default.aspx">Tips &amp; Tricks</category></item><item><title>Use Ctrl+. (period) to trigger Visual Studio’s automatic add using statement context menu</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/20/use-ctrl-period-to-trigger-visual-studio-s-automatic-add-using-statement-context-menu.aspx</link><pubDate>Wed, 21 Oct 2009 02:08:51 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7234412</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7234412</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7234412</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/20/use-ctrl-period-to-trigger-visual-studio-s-automatic-add-using-statement-context-menu.aspx#comments</comments><description>&lt;p&gt;When you type class names that are missing the correct namespace reference, Visual Studio will help you out by giving you a context menu that you can use to automatically add the correct using statement to the top of your class.&lt;/p&gt;  &lt;p&gt;For instance, in the example below, the Utility class exists in a different namespace that is not currently referenced in the class.&amp;#160; Visual Studio gives you the red squiggly to show there is an error but there also is a small little line at the end of the class name:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_4F6ABED5.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_79D6EFF2.png" width="324" height="100" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;You can take your mouse and hover just over that line and you will get a little drop-down context menu:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_4E2625F6.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_66B5C346.png" width="371" height="116" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Which is a very nice feature where Visual Studio will automatically add the using statement to the top of your file (or insert the full reference):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_2CC6805A.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_253B10ED.png" width="266" height="100" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The feature to add the using statement to your class is great in itself but getting your mouse into just the right spot to click that little line is pretty tricky (and also can break your development train of thought).&amp;#160; &lt;/p&gt;  &lt;p&gt;As the tool tip says, you can hit Shift+Alt+F10 to get the context menu but Ctrl+. (period) will also pop up that menu and it is a much easier key combination to use.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7234412" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Tips+_2600_+Tricks/default.aspx">Tips &amp; Tricks</category></item><item><title>Timestamp string with milliseconds from a System.DateTime</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/18/timestamp-string-with-milliseconds-from-a-system-datetime.aspx</link><pubDate>Mon, 19 Oct 2009 03:31:38 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7232746</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7232746</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7232746</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/18/timestamp-string-with-milliseconds-from-a-system-datetime.aspx#comments</comments><description>&lt;p&gt;You can easily convert a System.DateTime object into a string based on the current date and time by using the ToString() method of the DateTime object.&amp;#160; For instance:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;DateTime d = DateTime.Now;        &lt;br /&gt;String s = d.ToString(“yyyyMMdd-HHmmss”);&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Will produce a string with the value of “20091018-232013” assuming the date/time was 10/18/2009 11:20:13PM at the time the code was executed.&lt;/p&gt;  &lt;p&gt;But did you know you can get the milliseconds of that System.DateTime object by using the “fff” format string:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;DateTime d = DateTime.Now;        &lt;br /&gt;String s = d.ToString(“yyyyMMdd-HHmmss.fff”);&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Will produce a string with the value of “20091018-232013.456” assuming the date/time was 10/18/2009 11:20:13.456PM at the time the code was executed.&lt;/p&gt;  &lt;p&gt;I use this all the time when I need to append a timestamp to a log, a log filename, or just anything else that needs a quick way to turn a System.DateTime object into a string with milliseconds too.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:59bac112-3995-44e6-b572-5ad8162c387a" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/System.DateTime.ToString()" rel="tag"&gt;System.DateTime.ToString()&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7232746" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Tips+_2600_+Tricks/default.aspx">Tips &amp; Tricks</category></item><item><title>All of Kramer’s entrances on Seinfeld</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/18/all-of-kramer-s-entrances-on-seinfeld.aspx</link><pubDate>Mon, 19 Oct 2009 03:31:06 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7232745</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7232745</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7232745</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/18/all-of-kramer-s-entrances-on-seinfeld.aspx#comments</comments><description>&lt;p&gt;Every single Kramer entrance:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:c7d39af8-4142-4b5a-b8bf-bacbf49cfe3f" class="wlWriterSmartContent"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=XXSGV5wEv1o&amp;amp;feature=player_embedded" target="_new"&gt;&lt;img src="http://weblogs.asp.net/blogs/jeffwids/video7f5b4a8bfed6_6B81296D.jpg" style="border-style: none" galleryimg="no" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Thanks to the blog &lt;a href="http://www.ritholtz.com/blog/2009/10/every-single-kramer-entrance-in-chronological-order/"&gt;The Big Picture by Barry Ritholtz&lt;/a&gt; for pointing me there.&lt;/p&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7232745" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Seinfeld/default.aspx">Seinfeld</category></item><item><title>Parse a non-standard date string into a System.DateTime object</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/16/parse-a-non-standard-date-string-into-a-system-datetime-object.aspx</link><pubDate>Sat, 17 Oct 2009 01:22:42 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7231783</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7231783</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7231783</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/16/parse-a-non-standard-date-string-into-a-system-datetime-object.aspx#comments</comments><description>&lt;p&gt;The other day I had a date that was in the form of yyyyMMdd and I needed to parse that string into a System.DateTime object.&amp;#160; Just trying to parse the string into a System.DateTime object would not work:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;String dateString = &amp;quot;20091016&amp;quot;;       &lt;br /&gt;DateTime d = DateTime.Parse(dateString);&lt;/font&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;The above code results in an exception:&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre&gt;FormatException: String was not recognized as a valid DateTime.&lt;/pre&gt;
&lt;/blockquote&gt;

&lt;p&gt;I was guaranteed to have the date string in the form of yyyyMMdd so my initial thought was to use Substring to break it into the individual year, month, and day parts and create a new System.DateTime object from those pieces.&amp;#160; &lt;/p&gt;

&lt;p&gt;But then I discovered that you can use the DateTime.ParseExact method and a System.Globalization.DateTimeFormatInfo object to specify the pattern for the date that is being parsed.&amp;#160; &lt;/p&gt;

&lt;p&gt;Here is how I was able to parse a non-standard date string into a System.DateTime.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;&lt;font face="Courier New"&gt;System.Globalization.DateTimeFormatInfo di;
      &lt;br /&gt;di&lt;/font&gt;&lt;font face="Courier New"&gt; = new System.Globalization.DateTimeFormatInfo();
      &lt;br /&gt;di.FullDateTimePattern = &amp;quot;yyyyMMdd&amp;quot;; &lt;/font&gt;&lt;/p&gt;

  &lt;p&gt;&lt;font face="Courier New"&gt;String dateString = &amp;quot;20091016&amp;quot;;
      &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;DateTime d = DateTime.ParseExact(dateString, &amp;quot;F&amp;quot;, di); &lt;/font&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By the way, this is also a great way to parse a credit card expiration date that is in the form of MMyy to a System.DateTime.&amp;#160; Just use a pattern of MMyy for the FullDateTimePattern property.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2d119575-b17e-49cd-a82f-43ea1061d9a8" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/System.DateTime.ParseExact" rel="tag"&gt;System.DateTime.ParseExact&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C%23" rel="tag"&gt;C#&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7231783" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Tips+_2600_+Tricks/default.aspx">Tips &amp; Tricks</category></item><item><title>osql.exe and unicode files – how to save your sql scripts with encoding</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/14/osql-exe-and-unicode-files-how-to-save-your-sql-scripts-with-encoding.aspx</link><pubDate>Wed, 14 Oct 2009 13:43:18 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7229738</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7229738</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7229738</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/14/osql-exe-and-unicode-files-how-to-save-your-sql-scripts-with-encoding.aspx#comments</comments><description>&lt;p&gt;osql.exe is a great application for running sql scripts in a batch.&amp;#160; I use a batch file to execute multiple sql scripts that I use to rebuild my current application database from scratch.&amp;#160; When developing a brand new application, deploying a database in this way makes it really easy to recreate the database just like it will be created on Day 1 when you build out the Production environment. This requires scripting out all of your sql objects and then also having a way to execute all of those sql scripts easily.&amp;#160; That is where osql.exe comes in handy. &lt;/p&gt;  &lt;p&gt;But osql.exe does have one issue that I ran into this week where it does not like UTF-8 (codepage 65001) or UTF-7 (codepage 65000) encoded files.&amp;#160; And sometimes you need to include unicode characters in your sql scripts.&amp;#160; At first I thought osql just did not support unicode but that is not the case… it just does not like the UTF-8 or UTF-7 encoding.&amp;#160; &lt;/p&gt;  &lt;p&gt;Trying to run a UTF-8 (codepage 65001) or UTF-7 (codepage 65000) encoded file with osql.exe will give you errors such as:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font face="Courier New"&gt;Incorrect syntax near '+'.       &lt;br /&gt;Incorrect syntax near ' '.        &lt;br /&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;Incorrect syntax near 'ï'.&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Saving the same file with Unicode Encoding (codepage 1200) will work just fine.&amp;#160; Here is how to save sql scripts in Microsoft SQL Server Management Studio with a particular encoding (you can also use this method to see what type of encoding the file is saved in in the first place).&amp;#160; One other thing to note is that Visual Studio has this same type of Save As… functionality.&lt;/p&gt;  &lt;p&gt;From the Microsoft SQL Server Management Studio (or Visual Studio) File menu choose &lt;strong&gt;Save &lt;em&gt;[FILENAME]&lt;/em&gt; As…&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_307A4251.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_64AE6B97.png" width="151" height="273" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Then when the Save File As dialog appears you will see a little black arrow (inverted triangle) as part of the Save button.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_75B2997A.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_2E5D4388.png" width="235" height="87" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Clicking the &lt;em&gt;&lt;strong&gt;just&lt;/strong&gt;&lt;/em&gt; the inverted triangle portion of the button will give you a menu.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_095F830F.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_420A2D1C.png" width="211" height="124" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Choosing the Save with Encoding… option will then present you with an Advanced Save Options dialog.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_419DFA27.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_47E4D0B5.png" width="320" height="194" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jeffwids/image_71E4CEDD.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/jeffwids/image_thumb_463404E1.png" width="322" height="197" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Here is where you can specify the encoding to use for the file.&amp;#160; For osql.exe make sure you specify either Western European (Windows) – Codepage 1252 or Unicode – Codepage 1200.&amp;#160; Do not select UTF-8 (codepage 65001) or UTF-7 (codepage 65000) or osql.exe will give errors when trying to parse the file.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:faca08ef-b307-4ddc-9f71-c936567c914a" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Sql+Server+Management+Studio" rel="tag"&gt;Sql Server Management Studio&lt;/a&gt;,&lt;a href="http://technorati.com/tags/osql.exe" rel="tag"&gt;osql.exe&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Unicode+Encoding" rel="tag"&gt;Unicode Encoding&lt;/a&gt;,&lt;a href="http://technorati.com/tags/SQL+Scripts" rel="tag"&gt;SQL Scripts&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7229738" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Tips+_2600_+Tricks/default.aspx">Tips &amp; Tricks</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/osql.exe/default.aspx">osql.exe</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/Unicode+encoding/default.aspx">Unicode encoding</category></item><item><title>Asynchronously sending a System.Net.Mail.MailMessage in C#</title><link>http://weblogs.asp.net/jeffwids/archive/2009/10/12/asynchronously-sending-a-system-net-mail-mailmessage-in-c.aspx</link><pubDate>Tue, 13 Oct 2009 01:53:11 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:7228323</guid><dc:creator>Jeff Widmer</dc:creator><slash:comments>8</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/rsscomments.aspx?PostID=7228323</wfw:commentRss><wfw:comment xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/jeffwids/commentapi.aspx?PostID=7228323</wfw:comment><comments>http://weblogs.asp.net/jeffwids/archive/2009/10/12/asynchronously-sending-a-system-net-mail-mailmessage-in-c.aspx#comments</comments><description>&lt;p&gt;When sending an email in your ASP.NET application there are times when you do not want the user experience to slow just to wait for an email to be sent.&amp;#160; The code sample below is how to send a System.Net.Mail.MailMessage asynchronously so that the current thread can continue while a secondary thread sends the email.&amp;#160; &lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;public static void SendEmail(System.Net.Mail.MailMessage m)     &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; SendEmail(m, true);      &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;public static void SendEmail(System.Net.Mail.MailMessage m, Boolean Async)     &lt;br /&gt;{ &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; System.Net.Mail.SmtpClient smtpClient = null; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160; smtpClient = new System.Net.Mail.SmtpClient(&amp;quot;localhost&amp;quot;); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; if (Async)     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SendEmailDelegate sd = new SendEmailDelegate(smtpClient.Send);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; AsyncCallback cb = new AsyncCallback(SendEmailResponse);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sd.BeginInvoke(m, cb, sd);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; else      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; smtpClient.Send(m);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;      &lt;br /&gt;} &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;private delegate void SendEmailDelegate(System.Net.Mail.MailMessage m); &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;private static void SendEmailResponse(IAsyncResult ar)     &lt;br /&gt;{      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SendEmailDelegate sd = (SendEmailDelegate)(ar.AsyncState);&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font face="Consolas"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; sd.EndInvoke(ar);     &lt;br /&gt;}&lt;/font&gt; &lt;/p&gt;  &lt;p&gt;To use this just call the SendEmail() method with System.Net.Mail.MailMessage object.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:04068719-a0b9-491d-9bb3-4b8cbb6f22f8" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/System.Net.Mail.MailMessage" rel="tag"&gt;System.Net.Mail.MailMessage&lt;/a&gt;,&lt;a href="http://technorati.com/tags/c%23" rel="tag"&gt;c#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;&lt;/div&gt;&lt;div class="wlWriterHeaderFooter" style="margin:0px; padding:0px 0px 0px 0px;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;
tweetmeme_source = 'jeffwids';
&lt;/script&gt;
&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;&lt;/div&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7228323" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/jeffwids/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/jeffwids/archive/tags/C_2300_/default.aspx">C#</category></item></channel></rss>