<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/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>Bill Lin's Blog</title><link>http://blogs.msdn.com/bill/default.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Me in A Magic Session</title><link>http://blogs.msdn.com/bill/archive/2009/06/26/me-in-a-magic-session.aspx</link><pubDate>Sat, 27 Jun 2009 07:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9806342</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/bill/comments/9806342.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=9806342</wfw:commentRss><description>Other than being a software developer, I am also a magician. Check out this blog post&amp;nbsp;(you will probably have difficulties understanding some of the magic jargons if you are not a magician): &lt;A href="http://nnylfmit.blogspot.com/2009/06/no-way-jose.html"&gt;http://nnylfmit.blogspot.com/2009/06/no-way-jose.html&lt;/A&gt;.&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9806342" width="1" height="1"&gt;</description></item><item><title>Go, MSFT</title><link>http://blogs.msdn.com/bill/archive/2009/06/12/go-msft.aspx</link><pubDate>Sat, 13 Jun 2009 06:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9741753</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/9741753.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=9741753</wfw:commentRss><description>&lt;P&gt;As an employee, I am glad to see our stock price made new high today, while most other IT stocks went lower. The recent strong uptrend of MSFT shows the recognition on the value of Microsoft, at least by Wall Street. Anyway, we just announced Bing and Windows 7 is on its way. As a shareholder, I would like to see more future&amp;nbsp;growth of our company.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9741753" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>DOS Command Script: Use Date/Time in File Names</title><link>http://blogs.msdn.com/bill/archive/2009/02/13/file.aspx</link><pubDate>Fri, 13 Feb 2009 11:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9418038</guid><dc:creator>bill</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/bill/comments/9418038.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=9418038</wfw:commentRss><description>&lt;P&gt;Nowadays, we have&amp;nbsp;different choices of script languages in Windows: VBScript, JScript, PowerShell script, etc. Coming from the old DOS world, I still prefer a simple batch (.cmd) script.&lt;/P&gt;
&lt;P&gt;Say we have a simple sql query and we want to run it every 10 minutes and save the output to a file. We can simply have a scheduled job to run a .cmd file with the following content:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;sqlcmd -i query.sql -o report.txt&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;If we want to keep a history of the result,&amp;nbsp;it is best if we can have the date and time in the file name. So let us change it to&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;sqlcmd -i query.sql -o report-%date:~-4,4%%date:~-10,2%%date:~-7,2%-%time:~0,2%%time:~3,2%.txt&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The above command will run perfect between 10am and 11:59pm. Between 12am and 9:59am, however, %time:~0,2% will have a space (such as " 9") since %time%&amp;nbsp;formats&amp;nbsp;hours without leading 0.&lt;/P&gt;
&lt;P&gt;"time /t" command will always show hours with leading 0. So we have another idea:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;for /f "tokens=1,2 delims=: " %%i in ('time /t') do sqlcmd -i query.sql -o report-%date:~-4,4%%date:~-10,2%%date:~-7,2%-%%i%%j.txt&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The only problem here is "time /t" is&amp;nbsp;in 12hr format. So you could overwrite earlier results. It seems we still should use %time% and it will be perfect if we replace the space with 0 in the hours. So here is the final script which does the job:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;@echo off&lt;BR&gt;setlocal&lt;BR&gt;set timehour=%time:~0,2%&lt;BR&gt;sqlcmd -i query.sql -o report-%date:~-4,4%%date:~-10,2%%date:~-7,2%-%timehour: =0%%time:~3,2%.txt&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9418038" width="1" height="1"&gt;</description></item><item><title>Moving to Office</title><link>http://blogs.msdn.com/bill/archive/2009/02/12/moving-to-office.aspx</link><pubDate>Thu, 12 Feb 2009 11:05:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9414317</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/9414317.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=9414317</wfw:commentRss><description>&lt;P&gt;Re-orgs happen frequently at Microsoft and I am about to experience one.&lt;/P&gt;
&lt;P&gt;I just got two Ship-Its for the product I have been working on for almost 2 years, &lt;A href="http://home.microsoftequipt.com/" mce_href="http://home.microsoftequipt.com/"&gt;Microsoft Equipt&lt;/A&gt;, which will be discontinued after April 30th. We just finished the last feature of the product: requesting refund via the home page. The feature is now RTW. All in all, I have participated the design and implementation of all two versions of the product, starting from just an idea, all the way to its sunset.&lt;/P&gt;
&lt;P&gt;I am going to Join Office and work on a new product.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9414317" width="1" height="1"&gt;</description></item><item><title>Microsoft's Effort on 2008 Summer Olympics Coverage</title><link>http://blogs.msdn.com/bill/archive/2008/08/07/microsoft-s-effort-on-2008-summer-olympics-coverage.aspx</link><pubDate>Fri, 08 Aug 2008 06:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8842314</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/8842314.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=8842314</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Excited about upcoming Summer Olympics? Microsoft brings you a great digital coverage.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;I style="mso-bidi-font-style: normal"&gt;Extracted from a promotional email&lt;/I&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;On the eve of 08.08.08 and the&lt;SPAN style="COLOR: #1f497d"&gt; &lt;/SPAN&gt;excitement around the XXIX Olympiad, Microsoft and NBC Sports have teamed to deliver event coverage on a scale never seen before on the Internet, let alone on TV. &amp;nbsp;NBC and Microsoft will be streaming &lt;B&gt;more than 3,500 hours&lt;/B&gt; of Olympics video to millions of online viewers in the United States, including LIVE coverage of every minute of competition from 25 sports. &lt;SPAN style="COLOR: #1f497d"&gt;&amp;nbsp;&lt;/SPAN&gt;This is the largest media event ever done on the web, an &lt;B&gt;unprecedented moment in the history of the Internet&lt;/B&gt;. &amp;nbsp;…&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Here are all the ways you can experience the 2008 Summer Olympics from Microsoft and NBC:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Click &lt;A href="http://www.nbcolympics.com/video" target=_blank&gt;&lt;FONT color=#0000ff&gt;http://www.nbcolympics.com/video&lt;/FONT&gt;&lt;/A&gt; to jump right in and experience high-quality, interactive video using &lt;SPAN style="COLOR: #1f497d"&gt;&lt;A href="http://www.nbcolympics.com/silverlight/index.html"&gt;&lt;FONT color=#0000ff&gt;Silverlight&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt;.&lt;SPAN style="COLOR: #1f497d"&gt; &lt;/SPAN&gt;&amp;nbsp;This could even be better than being in Beijing! &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;…&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Beginning tomorrow and throughout the Games, the MSN homepage will prominently feature a dynamic Olympics module which will enable people to see results (or hide them if you don’t want any spoilers), get the latest news and see exclusive video coverage. &lt;SPAN style="COLOR: #1f497d"&gt;&amp;nbsp;…&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Get the latest &lt;A href="http://search.live.com/results.aspx?q=medal+count&amp;amp;form=QBRE" target=_blank&gt;&lt;FONT color=#0000ff&gt;medal counts&lt;/FONT&gt;&lt;/A&gt; by &lt;A href="http://search.live.com/results.aspx?q=olympic+swimming&amp;amp;go=&amp;amp;form=QBLH" target=_blank&gt;&lt;FONT color=#0000ff&gt;sport&lt;/FONT&gt;&lt;/A&gt; or by &lt;A href="http://search.live.com/results.aspx?q=usa+medal+count&amp;amp;form=QBRE" target=_blank&gt;&lt;FONT color=#0000ff&gt;country&lt;/FONT&gt;&lt;/A&gt;, or find out about all 10,000 of the &lt;A href="http://search.live.com/results.aspx?q=michael+phelps&amp;amp;form=QBRE" target=_blank&gt;&lt;FONT color=#0000ff&gt;athletes&lt;/FONT&gt;&lt;/A&gt; competing in the 2008 Summer Games using the &lt;B&gt;Live Search&lt;/B&gt; Olympics Instant Answer&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'"&gt;I&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;nstall the new &lt;SPAN style="COLOR: #1f497d"&gt;&lt;A href="http://www.newmsntoolbar.com/" target=_blank&gt;&lt;FONT color=#0000ff&gt;MSN Toolbar&lt;/FONT&gt;&lt;/A&gt;&lt;/SPAN&gt; that gives you one click access to the medal tally and many other highlights.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Beginning August 9th, &lt;A href="http://www.zune.net/en-US/" target=_blank&gt;&lt;FONT color=#0000ff&gt;Zune Marketplace&lt;/FONT&gt;&lt;/A&gt; will kick off a series of daily 2008 Olympic Games videos from NBC Sports, giving viewers special on-the-go access to the 2008 Beijing Olympic Games. For approximately 99 cents–$1.99 per episode (with post-Games content TBD), footage will include memorable highlights from the Opening and Closing Ceremonies, “best of” compilations, “best match” replays and a post-Games wrap-up feature. Users will be able to download each episode onto their Zune device for viewing whenever and wherever they go. &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;…&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;…&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 11pt; FONT-FAMILY: 'Calibri','sans-serif'"&gt;Check it out, tell your friends &amp;amp; enjoy&lt;SPAN style="COLOR: #1f497d"&gt;.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8842314" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/bill/archive/tags/Recommendations/default.aspx">Recommendations</category></item><item><title>Weird Error of Log Parser</title><link>http://blogs.msdn.com/bill/archive/2008/07/04/weird-error-of-log-parser.aspx</link><pubDate>Sat, 05 Jul 2008 00:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8692435</guid><dc:creator>bill</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/bill/comments/8692435.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=8692435</wfw:commentRss><description>&lt;P&gt;&lt;A href="http://www.microsoft.com/technet/scriptcenter/tools/logparser/" mce_href="http://www.microsoft.com/technet/scriptcenter/tools/logparser/"&gt;Log Parser&lt;/A&gt; is a great Microsoft tool for processing text-based data. Its scriptable COM components can be easily consumed by .NET applications.&lt;/P&gt;
&lt;P&gt;Recently I ran into an interesting error when using the COM components with C#. The data input for the parser is a TSV ((tab-separated values) formatted text log file. Here is code:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#2b91af&gt;LogQueryClassClass&lt;/FONT&gt; logQuery = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#2b91af&gt;LogQueryClassClass&lt;/FONT&gt;();&lt;BR&gt;&lt;FONT color=#2b91af&gt;COMTSVInputContextClassClass&lt;/FONT&gt; inputContext = &lt;FONT color=#0000ff&gt;new&lt;/FONT&gt; &lt;FONT color=#2b91af&gt;COMTSVInputContextClassClass&lt;/FONT&gt;();&lt;BR&gt;inputContext.iCheckpoint = &lt;FONT color=#a31515&gt;"MyCheckpoint.lpc"&lt;/FONT&gt;;&lt;BR&gt;&lt;FONT color=#2b91af&gt;ILogRecordset&lt;/FONT&gt; recordSet = logQuery.Execute(&lt;FONT color=#a31515&gt;"SELECT * FROM test.log"&lt;/FONT&gt;, inputContext);&lt;/P&gt;
&lt;P&gt;I got all NULL values in the result records&amp;nbsp;or the following exception:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Unhandled Exception: System.Runtime.InteropServices.COMException (0x80094004): Error parsing query: Header for file "test.log" contains an empty field name declaration [Unknown Error]&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;The weird thing is if I commented out the line which assigns iCheckpoint for incremental parsing, the code would work. Eventually I found out that I needed to specify the CodePage of the inputContext since the text input was encoded in Unicode. So the solution is to add the following line:&lt;/P&gt;
&lt;P&gt;inputContext.CodePage = -1; &lt;FONT color=#008000&gt;// -1 is Unicode, default (0) is the system codepage&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8692435" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>Live Maps China RTW</title><link>http://blogs.msdn.com/bill/archive/2007/12/12/live-maps-china-rtw.aspx</link><pubDate>Thu, 13 Dec 2007 09:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6755992</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/6755992.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=6755992</wfw:commentRss><description>&lt;P&gt;I got an email this morning saying the LIve Maps China was live today. According to the email, this first public release supports most basic map and local search features across China with details for 114 cities, plus a Public Transit feature for 11 cities,&lt;/P&gt;
&lt;P&gt;I found my high school in the map and even the cafererias in my university.&lt;/P&gt;
&lt;P&gt;If you know Chinese, try it now: &lt;A href="http://ditu.live.com/" mce_href="http://ditu.live.com/"&gt;http://ditu.live.com/&lt;/A&gt; ('ditu' means 'maps' in Chinese)&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://blufiles.storage.live.com/y1prMEydMCg3Uts3a2LNFvssVOGR7-tvSmF7y6XaK6gmRm86h_RfMZhiuLTPm5dnfGsVhlSAyBg0wU" mce_src="http://blufiles.storage.live.com/y1prMEydMCg3Uts3a2LNFvssVOGR7-tvSmF7y6XaK6gmRm86h_RfMZhiuLTPm5dnfGsVhlSAyBg0wU"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6755992" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/bill/archive/tags/Recommendations/default.aspx">Recommendations</category></item><item><title>SQLClient Support for the New Date and Time Types in SQL Server 2008</title><link>http://blogs.msdn.com/bill/archive/2007/11/25/sqlclient-support-for-the-new-date-and-time-types-in-sql-server-2008.aspx</link><pubDate>Sun, 25 Nov 2007 12:19:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6512638</guid><dc:creator>bill</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/bill/comments/6512638.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=6512638</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Prior to &lt;I style="mso-bidi-font-style: normal"&gt;SQL Server 2008&lt;/I&gt;, SQL developers were restricted to using two types to work with date and time values: &lt;B style="mso-bidi-font-weight: normal"&gt;datetime&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;smalldatetime&lt;/B&gt;. While they are sufficient in most user scenarios, there are some limitations:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;1)&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;Both types include both the date value and time value. There is no way to store only the date or time part. This causes wasted storage and difficulties in computation and indexing.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;2)&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;The range supported of the &lt;B style="mso-bidi-font-weight: normal"&gt;datetime&lt;/B&gt; type does not align with the range of .NET CLR DateTime type.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;3)&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;The &lt;B style="mso-bidi-font-weight: normal"&gt;datetime&lt;/B&gt; precision of .333 seconds is not sufficient for some applications.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri size=3&gt;4)&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT face=Calibri size=3&gt;The types are not time-zone aware.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;To address these limitations, &lt;I style="mso-bidi-font-style: normal"&gt;SQL Service 2008&lt;/I&gt; introduced four &lt;/FONT&gt;&lt;A href="http://www.sqlservercentral.com/links/98053/7262" mce_href="http://www.sqlservercentral.com/links/98053/7262"&gt;&lt;FONT face=Calibri color=#0000ff size=3&gt;new date/time data types&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt;: &lt;B style="mso-bidi-font-weight: normal"&gt;date&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;time&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;datetime2&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;datetimeoffset&lt;/B&gt;. The first two types are date-only and time-only respectfully. &lt;B style="mso-bidi-font-weight: normal"&gt;time&lt;/B&gt; type supports user-defined fractional second precision. &lt;B style="mso-bidi-font-weight: normal"&gt;datetime2&lt;/B&gt; combines &lt;B style="mso-bidi-font-weight: normal"&gt;date&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;time&lt;/B&gt; into a single data type. &lt;B style="mso-bidi-font-weight: normal"&gt;datetimeoffset&lt;/B&gt; has all the features of &lt;B style="mso-bidi-font-weight: normal"&gt;datetime2&lt;/B&gt; with an additional time zone offset. The range of &lt;B style="mso-bidi-font-weight: normal"&gt;datetime2&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;datetimeoffset&lt;/B&gt; are fully aligned with the .net CLR types DateTime and &lt;/FONT&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/system.datetimeoffset(vs.90).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.datetimeoffset(vs.90).aspx"&gt;&lt;FONT face=Calibri color=#0000ff size=3&gt;DateTimeOffset&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Calibri size=3&gt; (introduced in .NET Framework 3.5).&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;In .NET Framework 3.5, SQLClient has been extended to support the four new types.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;Type Version System&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;To enable the feature, the first step is to explicitly specify the &lt;I style="mso-bidi-font-style: normal"&gt;Type Version System&lt;/I&gt; to &lt;B style="mso-bidi-font-weight: normal"&gt;SQL Server 2008&lt;/B&gt; or &lt;B style="mso-bidi-font-weight: normal"&gt;Latest&lt;/B&gt; in the connection string. Otherwise, the client would be treated like a SQL Server 2005 client. Here is the code snippet:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;SqlConnection&lt;/SPAN&gt; conn = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;SqlConnection&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"Server=localhost;Integrated Security=SSPI;Type System Version=SQL Server 2008"&lt;/SPAN&gt;))&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;conn.Open();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;//...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;Scale for time, datetime2, and datetimeoffset&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;For &lt;B style="mso-bidi-font-weight: normal"&gt;time&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;datetime2&lt;/B&gt;, and &lt;B style="mso-bidi-font-weight: normal"&gt;datetimeoffset&lt;/B&gt;, users are allowed to define the fractional second precision. It might sound confusing, the correct term for it is &lt;I style="mso-bidi-font-style: normal"&gt;scale&lt;/I&gt;. With scale = &lt;I style="mso-bidi-font-style: normal"&gt;x&lt;/I&gt;, the increment would be 1/10&lt;I style="mso-bidi-font-style: normal"&gt;&lt;SUP&gt;X&lt;/SUP&gt;&lt;/I&gt; seconds. So you should use the Scale property in SqlParameter to specify the fractional second precision and you look for the Scale column in the schema table returned by SqlDataReader.GetSchemaTable().&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt; mso-themecolor: text2"&gt;&lt;FONT face=Calibri&gt;CLR Type Mapping and Inference&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;date&lt;/B&gt;, &lt;B style="mso-bidi-font-weight: normal"&gt;datetime2&lt;/B&gt; are mapped to DateTime. &lt;B style="mso-bidi-font-weight: normal"&gt;time&lt;/B&gt; is mapped to TImeSpan. &lt;B style="mso-bidi-font-weight: normal"&gt;datetimeoffset&lt;/B&gt; is mapped to DateTimeOffset. &lt;B style="mso-bidi-font-weight: normal"&gt;datetime2&lt;/B&gt; and &lt;B style="mso-bidi-font-weight: normal"&gt;datetimeoffset&lt;/B&gt; have the same range as their CLR counterparts.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;For SqlParameter, if you use AddWithValue method, DateTime would always be inferred as &lt;B style="mso-bidi-font-weight: normal"&gt;datetime&lt;/B&gt;. To explicit specify the value as &lt;B style="mso-bidi-font-weight: normal"&gt;datetime2&lt;/B&gt;, you need to set the SqlDbType to SqlDbType.DateTime2.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt; mso-themecolor: text2"&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: #1f497d; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt; mso-themecolor: text2"&gt;Some New SqlClient APIs Related to New Date/Time Types&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; mso-themecolor: text2"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;New SqlDbType enumerations:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;SqlDbType.Date&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;SqlDbType.Time&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;SqlDbType.DateTime2&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;SqlDbType.DateTimeOffset&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;New SqlDataReader methods:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;SqlDataReader.GetDateTimeOffset()&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Calibri size=3&gt;SqlDataReader.GetTimeSpan()&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6512638" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/ADO.NET/default.aspx">ADO.NET</category></item><item><title>Lessons Learned from A Scam</title><link>http://blogs.msdn.com/bill/archive/2007/08/08/lessons-learned-from-a-scam.aspx</link><pubDate>Thu, 09 Aug 2007 07:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4320168</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/4320168.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=4320168</wfw:commentRss><description>&lt;P&gt;This post contains some hard lessons I recently learned through a &lt;A href="http://seattle.craigslist.org/" mce_href="http://seattle.craigslist.org/"&gt;craigslist&lt;/A&gt; transaction. Hopefully it could help you to become more cautious if you decide to sell something through craigslist or other similar online sites.&lt;/P&gt;
&lt;P&gt;A while ago I won a competition at the company and the prize was an Xbox 360 with a 20G hard drive. However, I'm not a big fan of video games and I decided to sell the brand-new sealed package. Since I had some previous good experience with selling things through craigslist, I posted an ad in craigslist again this time. In Amazon the retail price for this type of Xbox 360 is $400 and I asked for $300. It was obviously a good deal and a few guys replied to the ad immediately after it was posted. I decided to make a deal with the guy who replied first. He asked to meet in the same afternoon. We made the transaction and everything seemed to be running smoothly. However, later in the evening, the guy sent me an email claiming the hard drive didn't work. I was a little bit surprised because when I handed it to him, the box was still sealed.&lt;/P&gt;
&lt;P&gt;I replied the next morning to talk with him and ask for the error he got. I told him it's hard to find out exactly when the hard drive went wrong but I'd like to help to solve the problem by contacting Microsoft Support. However, he became nasty and claimed I was running a scam. In his email, he talked to me in a very threatening way. He said he recorded my license plate number (and proved it by including the correct number in the e-mail) and he would take care of this the hard way if I didn't refund him. This was totally unexpected as I was responding to his emails all the way along. To avoid confrontation with a potentially dangerous guy, I refund him fully in the same evening. However, after coming back home, I found the controller was missing in the box. Since then, he has never answered my calls or replied to my emails.&lt;/P&gt;
&lt;P&gt;I’m very suspicious he actually conned me. I feel it’s possible the original Xbox has no problem at all and he just replaced it with a bad hard drive and stole the controller with it. The email he sent to me was just to scare me and make me refund him his money.&lt;/P&gt;
&lt;P&gt;Several lessons learned:&lt;/P&gt;
&lt;P&gt;1. &lt;B&gt;Always be very cautious when you use any public sites to make some deals.&lt;/B&gt; I'm not complaining about any specific website but most of them are open to everyone. It would be safer if the targeted audience could be limited. As far as I know, in &lt;A href="http://expo.live.com/" mce_href="http://expo.live.com/"&gt;Windows Live Expo&lt;/A&gt;, you could specify that the ads you've posted can only be viewed by people in your community, such as among all Microsoft employees.&lt;/P&gt;
&lt;P&gt;2. &lt;B&gt;Protect your identity as much as possible when dealing with strangers from the Internet.&lt;/B&gt; Only provide necessary information. Of course, if someone acts like this guy who purposely recorded your license plate number during the meeting, there's not a lot you could do about it.&lt;/P&gt;
&lt;P&gt;3. &lt;B&gt;Don't lose your composure.&lt;/B&gt; I could have found out the controller was missing up front if I had more composure. Of course the result might still be the same: the guy could have claimed he would bring it another time and then disappeared.&lt;/P&gt;
&lt;P&gt;Meanwhile, doing business online can be enjoyable and I wish everybody good luck.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4320168" width="1" height="1"&gt;</description></item><item><title>Performance Tips with SqlClient</title><link>http://blogs.msdn.com/bill/archive/2007/06/10/performance-tips-with-sqlclient.aspx</link><pubDate>Mon, 11 Jun 2007 09:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3223480</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/3223480.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=3223480</wfw:commentRss><description>&lt;P&gt;Here's a list of things to know if you'd like achieve the best performance/scalability with SqlClient:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use &lt;A href="http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx"&gt;SqlBulkCopy&lt;/A&gt; to send large sets of data to the server&lt;/LI&gt;
&lt;LI&gt;Set &lt;A href="http://msdn2.microsoft.com/en-us/library/system.data.common.dbdataadapter.updatebatchsize.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.data.common.dbdataadapter.updatebatchsize.aspx"&gt;DbDataAdapter.UpdateBatchSize&lt;/A&gt; to send batches to the server&lt;/LI&gt;
&lt;LI&gt;Use strongly typed getters instead of GetValue/GetSqlValue&lt;/LI&gt;
&lt;LI&gt;Turn on CommandBehavior.SequentialAccess and call GetChars/GetBytes when working with BLOBs&lt;/LI&gt;
&lt;LI&gt;Use parameterized queries (Avoids conversion to and from nchar type)&lt;/LI&gt;
&lt;LI&gt;Wrap multi-step operations in a transaction&lt;/LI&gt;
&lt;LI&gt;Use connection pooling&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;You might also be interested in check out this article: &lt;A href="http://msdn2.microsoft.com/en-us/library/ms998569.aspx"&gt;Improving ADO.NET Performance&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3223480" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/ADO.NET/default.aspx">ADO.NET</category></item><item><title>Seattle Works Day 2007</title><link>http://blogs.msdn.com/bill/archive/2007/06/09/seattle-works-day-2007.aspx</link><pubDate>Sun, 10 Jun 2007 08:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3198238</guid><dc:creator>bill</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/bill/comments/3198238.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=3198238</wfw:commentRss><description>&lt;P&gt;1,000+ participants at 30+ project sites added up to nearly 4,000 hours of service in a single day. &lt;A href="http://www.seattleworks.org/AboutUs/index.php/SWD/swd_intro.html"&gt;Seattle Works Day&lt;/A&gt; is a fun and easy way to green up Seattle.&lt;/P&gt;
&lt;P&gt;Microsoft also broke Seattle Works Day records. We had three projects this year with over 300 participants - our largest group ever. Microsoft has sponsored each individual on the Microsoft team so it's free for us.&lt;/P&gt;
&lt;P&gt;I signed up for the &lt;A href="http://www.seattleschools.org/area/main/ShowSchool?sid=117"&gt;Washington Middle School&lt;/A&gt; project. We went weeding, edging, and laying bark mulch at the school. Our help is important as the Seattle School District has limited resources and they have committed to reducing the use of pesticides to make this area safer for all.&lt;/P&gt;
&lt;P&gt;The good: the Green theme. It's great to see we're making an effort to keep our urban green spaces beautiful and available for safe outdoor recreational activities.&lt;/P&gt;
&lt;P&gt;The bad: nothing really bad, although I felt the music was a little too loud at the after-party. It could have been easier for me to meet more people and talk with them.&lt;/P&gt;
&lt;P&gt;The dirty: it was raining throughout the time we were doing the project. I'm actually a special person who enjoys raining. With the rain, getting dirty part is even more fun. :)&lt;/P&gt;
&lt;P&gt;I joined Seattle Works Day 2006 and I'm looking forward to Seattle Works Day 2008.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.seattleworks.org/AboutUs/index.php/SWD/SWDimages/swdwebbannerintro.bmp" mce_src="http://www.seattleworks.org/AboutUs/index.php/SWD/SWDimages/swdwebbannerintro.bmp"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3198238" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>New Adventure</title><link>http://blogs.msdn.com/bill/archive/2007/05/30/new-adventure.aspx</link><pubDate>Thu, 31 May 2007 06:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2998156</guid><dc:creator>bill</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/bill/comments/2998156.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=2998156</wfw:commentRss><description>&lt;P&gt;After working in SQL for more than 19 months, I have decided to pursue a new opportunity in Office Live. On June 1, I’ll begin my Office Live adventure.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2998156" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>Microsoft Surface</title><link>http://blogs.msdn.com/bill/archive/2007/05/30/microsoft-surface.aspx</link><pubDate>Wed, 30 May 2007 10:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2983085</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/2983085.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=2983085</wfw:commentRss><description>&lt;P&gt;Cool product, cool name, cool website. I saw the demo in our company meeting and I really like it.&lt;BR&gt;&lt;A href="http://www.microsoft.com/surface/" mce_href="http://www.microsoft.com/surface/"&gt;http://www.microsoft.com/surface/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://blufiles.storage.msn.com/y1p9r84XjZ_gCcv4DfAjfAdC9AYTJXYYr2pClIin3AVsB4JZYlcnRxfavfDRKZqyqneAI9GDhMpcag64rm0v8RX0Q"&gt;&lt;/P&gt;
&lt;P&gt;Executive Q&amp;amp;A: What the new surface computing category means for Microsoft and consumers&lt;BR&gt;&lt;A href="http://www.microsoft.com/presspass/features/2007/may07/05-29Surface.mspx" mce_href="http://www.microsoft.com/presspass/features/2007/may07/05-29Surface.mspx"&gt;http://www.microsoft.com/presspass/features/2007/may07/05-29Surface.mspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Microsoft Launches New Product Category: Surface Computing Comes to Life in Restaurants, Hotels, Retail Locations and Casino Resorts&lt;BR&gt;&lt;A href="http://www.microsoft.com/presspass/press/2007/may07/05-29MSSurfacePR.mspx" mce_href="http://www.microsoft.com/presspass/press/2007/may07/05-29MSSurfacePR.mspx"&gt;http://www.microsoft.com/presspass/press/2007/may07/05-29MSSurfacePR.mspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2983085" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>10 Reinvigorating Facts About Microsoft's Profits</title><link>http://blogs.msdn.com/bill/archive/2007/05/27/10-reinvigorating-facts-about-microsoft-s-profits.aspx</link><pubDate>Mon, 28 May 2007 02:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2930321</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/2930321.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=2930321</wfw:commentRss><description>&lt;P&gt;I'd like to share an interesting article on Microsoft's profits published a while ago:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://biz.yahoo.com/seekingalpha/070430/33932_id.html?.v=1" mce_href="http://biz.yahoo.com/seekingalpha/070430/33932_id.html?.v=1"&gt;10 Reinvigorating Facts About Microsoft's Profits&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Microsoft last week announced quarterly revenue of $14.4 billion and net income of $4.93 billion. In other words, Microsoft's daily net income is about $55 million. That's $55 million in pure profit every 24 hours. Do some quick math and you'll learn it takes Microsoft only about... &lt;/P&gt;
&lt;LI&gt;10 hours or so (yes, hours!) to exceed Red Hat's (NYSE: &lt;A href="http://finance.yahoo.com/q?s=rht&amp;amp;d=t"&gt;RHT&lt;/A&gt; - &lt;A href="http://finance.yahoo.com/q/h?s=rht"&gt;News&lt;/A&gt;) quarterly net income of &lt;A href="http://www.redhat.com/about/news/prarchive/2007/fiscal.html"&gt;$20.5 million&lt;/A&gt;. 
&lt;LI&gt;four days to exceed Research In Motion's (NasdaqGS: RIMM) quarterly net income of &lt;A href="http://www.rim.net/investors/releases/2007/pr-11_04_2007-01.shtml"&gt;$187.9 million&lt;/A&gt;. 
&lt;LI&gt;four days to exceed Starbucks' (NasdaqGS: SBUX) quarterly net income of &lt;A href="http://investor.starbucks.com/phoenix.zhtml?c=99518&amp;amp;p=irol-news&amp;amp;nyo=0\"&gt;$205 million&lt;/A&gt;. 
&lt;LI&gt;one week to exceed Nike's (NYSE: &lt;A href="http://finance.yahoo.com/q?s=nke&amp;amp;d=t"&gt;NKE&lt;/A&gt; - &lt;A href="http://finance.yahoo.com/q/h?s=nke"&gt;News&lt;/A&gt;) quarterly net income of &lt;A href="http://www.nike.com/nikebiz/news/pressrelease.jhtml?year=2007&amp;amp;month=03&amp;amp;letter=h\"&gt;$350.8 million&lt;/A&gt;. 
&lt;LI&gt;two weeks to exceed McDonalds' (NYSE: &lt;A href="http://finance.yahoo.com/q?s=mcd&amp;amp;d=t"&gt;MCD&lt;/A&gt; - &lt;A href="http://finance.yahoo.com/q/h?s=mcd"&gt;News&lt;/A&gt;) quarterly net income of &lt;A href="http://www.mcdonalds.com/corp/news/fnpr/2007/fpr_042007.html"&gt;$762 million&lt;/A&gt;. 
&lt;LI&gt;two weeks to exceed Apple's (NasdaqGS: AAPL) quarterly net income of &lt;A href="http://www.apple.com/pr/library/2007/04/25results.html"&gt;$770 million&lt;/A&gt;. 
&lt;LI&gt;18 days to exceed Google's (NasdaqGS: GOOG) quarterly net income of &lt;A href="http://www.google.com/intl/en/press/pressrel/revenues_q107.html"&gt;$1 billion&lt;/A&gt;. 
&lt;LI&gt;23 days to exceed Coca-Cola's (NYSE: &lt;A href="http://finance.yahoo.com/q?s=ko&amp;amp;d=t"&gt;KO&lt;/A&gt; - &lt;A href="http://finance.yahoo.com/q/h?s=ko"&gt;News&lt;/A&gt;) quarterly net income of &lt;A href="http://www.thecoca-colacompany.com/presscenter/nr_20070417_corporate_first_qtr_earnings.html"&gt;$1.26 billion&lt;/A&gt;. 
&lt;LI&gt;five weeks to exceed IBM's (NYSE: &lt;A href="http://finance.yahoo.com/q?s=ibm&amp;amp;d=t"&gt;IBM&lt;/A&gt; - &lt;A href="http://finance.yahoo.com/q/h?s=ibm"&gt;News&lt;/A&gt;) quarterly net income of &lt;A href="http://www.ibm.com/investor/1q07/1q07earnings.phtml"&gt;$1.85 billion&lt;/A&gt;. 
&lt;LI&gt;10 weeks to exceed Wal-Mart's (NYSE: &lt;A href="http://finance.yahoo.com/q?s=wmt&amp;amp;d=t"&gt;WMT&lt;/A&gt; - &lt;A href="http://finance.yahoo.com/q/h?s=wmt"&gt;News&lt;/A&gt;) quarterly net income of &lt;A href="http://investor.walmartstores.com/phoenix.zhtml?c=112761&amp;amp;p=irol-news"&gt;$3.9 billion&lt;/A&gt;.&lt;/LI&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;While I feel impressed and proud, I realize it's challenging for Microsoft to keep or even exceed the current achievement. To grow a multi-billion business, in my opinion, is way harder than to grow a multi-million business. The dynamics of the IT software industry are changing in a very fast pace. Customers expect constantly innovations and there’re new competitors coming up every day. Nevertheless, I strongly believe Microsoft will continue to excel with her smart employees, firm leadership, and healthy corporate culture.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2930321" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category></item><item><title>Progressive Development</title><link>http://blogs.msdn.com/bill/archive/2007/04/19/progressive-development.aspx</link><pubDate>Thu, 19 Apr 2007 11:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2188733</guid><dc:creator>bill</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/bill/comments/2188733.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bill/commentrss.aspx?PostID=2188733</wfw:commentRss><description>&lt;P&gt;My mentor James at Microsoft recently started a blog with the name "Progressive Development". It talks about best and worst practices of software engineering in the format of entertaining conversations between two figures Motley and Maven.&lt;/P&gt;
&lt;P&gt;I knew James through his class at Microsoft and he is a fantastic teacher with excellent engineering knowledge and passion on software quality. His blog entries on engineering practices are definitely worth reading.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/progressive_development/" mce_href="http://blogs.msdn.com/progressive_development/"&gt;Progressive Development: Zany Adventures in Software Engineering with Maven and Motley&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2188733" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bill/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://blogs.msdn.com/bill/archive/tags/Recommendations/default.aspx">Recommendations</category></item></channel></rss>