<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://msmvps.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>Usable Asp.Net</title><link>http://msmvps.com/blogs/egoldin/default.aspx</link><description>Little things that make Asp.Net more usable</description><dc:language>en</dc:language><generator>CommunityServer 2008.5 SP2 (Build: 40407.4157)</generator><item><title>How to tell the page is in AJAX call</title><link>http://msmvps.com/blogs/egoldin/archive/2008/05/21/how-to-tell-the-page-is-in-ajax-call.aspx</link><pubDate>Wed, 21 May 2008 15:19:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1625602</guid><dc:creator>egoldin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=1625602</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2008/05/21/how-to-tell-the-page-is-in-ajax-call.aspx#comments</comments><description>&lt;p&gt;The way to tell if the page is in an AJAX call is to check the ScriptManager.IsInAsyncPostBack property.&lt;/p&gt;
&lt;p&gt;Sounds trivial. &lt;/p&gt;
&lt;p&gt;The only reason I am writting about that is&amp;nbsp;the very common confusion with the Page.IsAsync property that has absolutely nothing to do with AJAX.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1625602" width="1" height="1"&gt;</description></item><item><title>Reporting Errors in Login Control</title><link>http://msmvps.com/blogs/egoldin/archive/2008/03/25/reporting-errors-in-login-control.aspx</link><pubDate>Tue, 25 Mar 2008 12:51:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1552862</guid><dc:creator>egoldin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=1552862</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2008/03/25/reporting-errors-in-login-control.aspx#comments</comments><description>&lt;p&gt;Login control has a FailureText property that holds the text to display to the user when a login attempt fails.&lt;/p&gt;
&lt;p&gt;What if you want to report errors before making an login attempt? For example, you may handle the LoggingIn event to check a &amp;quot;IsDeleted&amp;quot; flag on user record and, if it is set, provide an error &amp;quot;The user is inactive&amp;quot;.&amp;nbsp;How can you set the error text without making an login attempt?&lt;/p&gt;
&lt;p&gt;This code will do that:&lt;/p&gt;&lt;font color="#0000ff" size="1"&gt;protected&lt;/font&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;void&lt;/font&gt;&lt;font size="1"&gt; LoggingIn(&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;object&lt;/font&gt;&lt;font size="1"&gt; sender, System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Web&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;UI&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;WebControls&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;LoginCancelEventArgs e)&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; 
&lt;p&gt;{&lt;/p&gt;
&lt;blockquote&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;string&lt;/font&gt;&lt;font size="1"&gt; userName &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;this.&lt;/font&gt;&lt;font size="1"&gt;Login1&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;UserName;&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="1"&gt;// validate the user&lt;/p&gt;&lt;/font&gt;&lt;font size="1"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;if&lt;/font&gt;&lt;font size="1"&gt; (IsUserDeleted(userName))&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;font size="1"&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="1"&gt;// deleted, cancel login&lt;/p&gt;&lt;/font&gt;&lt;font size="1"&gt;
&lt;p&gt;e&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Cancel &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;true&lt;/font&gt;&lt;font size="1"&gt;;&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#008000" size="1"&gt;// notify the user&lt;/p&gt;&lt;/font&gt;&lt;font size="1"&gt;(&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;this.&lt;/font&gt;&lt;font size="1"&gt;Login1&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;FindControl(&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;&amp;quot;FailureText&amp;quot;&lt;/font&gt;&lt;font size="1"&gt;) &lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;as&lt;/font&gt;&lt;font size="1"&gt; System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Web&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;UI&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;WebControls&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Literal)&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Text &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;String&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Format(&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;&amp;quot;The user {0} is inactive&amp;quot;&lt;/font&gt;&lt;font size="1"&gt;, userName);&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt;&lt;/blockquote&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1552862" width="1" height="1"&gt;</description></item><item><title>Customizing web.config for different environments</title><link>http://msmvps.com/blogs/egoldin/archive/2008/03/16/customizing-web-config-for-different-environments.aspx</link><pubDate>Sun, 16 Mar 2008 10:36:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1544405</guid><dc:creator>egoldin</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=1544405</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2008/03/16/customizing-web-config-for-different-environments.aspx#comments</comments><description>&lt;p&gt;This is a very common scenario.&lt;/p&gt;
&lt;p&gt;You develop your application in environment A. The production will run in environment B. There will be also a demo site in environment C and a test site in environment D. The environments may have different connection strings, account identities, custom application settings, whatever else you may or may not think of. You clearly need to give to every environment its own web.config file. Or modify the setting in run time depending on what&amp;nbsp;environment the application is running in.&lt;/p&gt;
&lt;p&gt;On other hand, your web.config includes sections common for all environments and you wouldn&amp;#39;t like to maintain the same setting in four places. Another issue is that, when you publish the site, the development web.config is going to overwrite the target one that already has been customized for the target environment.&lt;/p&gt;
&lt;p&gt;There is a simple solution with no coding involved. Make use of the configSource property for the sections you need to customize.&lt;/p&gt;The configSource is basically the name of the include file in which the associated section is defined. Leave in the web.config only the sections common for all environments and take all variable sections out to separate files. For examle, the connectionString section in the web.config file will look like this:&amp;nbsp;&lt;font color="#0000ff" size="1"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; 
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;connectionStrings&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="1"&gt;configSource&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;SiteSettings\connectionStrings.config&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;/&amp;gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;Note that the configSource is set to&amp;nbsp;the physical location of the file relatively to the location of the web.config.The content of the connectionStrings.config&amp;nbsp;will be:&lt;/p&gt;&lt;font color="#0000ff" size="1"&gt;
&lt;p&gt;&amp;lt;?&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;xml&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="1"&gt;version&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;1.0&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="1"&gt;encoding&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;utf-8&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; ?&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="1"&gt;&amp;lt;!--&lt;/font&gt;&lt;font color="#008000" size="1"&gt; This file is an extension of the application web.config file. The root element must be &amp;lt;connectionStrings&amp;gt;.&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;--&amp;gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; &lt;/font&gt;&lt;/p&gt;&lt;font color="#0000ff" size="1"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;connectionStrings&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;
&lt;blockquote&gt;
&lt;p&gt;&amp;lt;&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;add&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="1"&gt;name&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;SiteSqlServer&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; &lt;/font&gt;&lt;font color="#ff0000" size="1"&gt;connectionString&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;Integrated Security=SSPI;database=DbDemo;&lt;/font&gt;&lt;font size="1"&gt;&amp;quot;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt; /&amp;gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;
&lt;p&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;connectionStrings&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;&amp;gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;You can&amp;nbsp;make separate&amp;nbsp;config files for as many sections as you wish. Put&amp;nbsp;them all in a single directory. In our case it is SiteSettings.&lt;/p&gt;
&lt;p&gt;Now,&amp;nbsp;in our example with four environments you&amp;nbsp;would make four sets of section config files in four directories&amp;nbsp;and deploy each one to the corresponding environment. It is important not to include any of the config section directories into your solution. This will ensure that you won&amp;#39;t overwrite the correct&amp;nbsp;settings on the target site with your development ones on every publishing.&lt;/p&gt;
&lt;p&gt;Now you can modify the common sections of&amp;nbsp;your web.config and publish it to all targets. The targets will keep their customized config sections intact.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1544405" width="1" height="1"&gt;</description></item><item><title>Application Pool Identity on Win2003</title><link>http://msmvps.com/blogs/egoldin/archive/2008/03/16/application-pool-identity-on-win2003.aspx</link><pubDate>Sun, 16 Mar 2008 10:23:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1544365</guid><dc:creator>egoldin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=1544365</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2008/03/16/application-pool-identity-on-win2003.aspx#comments</comments><description>&lt;p&gt;This can be trivial for those fluent in IIS and Windows security. Not so for&amp;nbsp;regular developers who need to impersonate their applications in IIS.&lt;/p&gt;
&lt;p&gt;To get your application pool run under another user account, that user account needs to be a member of the IIS_WPG security group.&lt;/p&gt;
&lt;p&gt;Hope this will save someone hours of work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1544365" width="1" height="1"&gt;</description></item><item><title>VS2008 freezes after builds</title><link>http://msmvps.com/blogs/egoldin/archive/2008/02/14/vs2008-freezes-after-builds.aspx</link><pubDate>Thu, 14 Feb 2008 23:00:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1514659</guid><dc:creator>egoldin</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=1514659</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2008/02/14/vs2008-freezes-after-builds.aspx#comments</comments><description>&lt;p&gt;Recently my Visual Studio started freezing for 1-3 minutes after every build, no matter successful or not, debug or release. Save All operation also became very slow. This was extremely annoying. Eventually, I found the culprit. My solution .suo file grew quite big. I just deleted it and all delays gone.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1514659" width="1" height="1"&gt;</description></item><item><title>Resetting ChangePassword control</title><link>http://msmvps.com/blogs/egoldin/archive/2007/10/30/reseting-changepassword-control.aspx</link><pubDate>Tue, 30 Oct 2007 10:32:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1274484</guid><dc:creator>egoldin</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=1274484</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2007/10/30/reseting-changepassword-control.aspx#comments</comments><description>&lt;p&gt;If you try using the ChangePassword control for changing several passwords on the same page, you will notice that after confirming successful password change the control always shows the same success message and doesn&amp;#39;t offer any text entry fields any more. The reason is that the control maintains an internal state machine and doesn&amp;#39;t reset it properly after succes password changes. The state machine is controlled by internal property CurrentView that is not available for direct setting. But you can set it using reflection like this:&lt;/p&gt;&lt;font size="1"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;private&lt;/font&gt;&lt;font size="1"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;void&lt;/font&gt;&lt;font size="1"&gt; resetChangePasswordState(System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Web&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;UI&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;WebControls&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;ChangePassword&lt;/font&gt;&lt;font size="1"&gt; cpControl)&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; 
&lt;p&gt;{&lt;/p&gt;&lt;/font&gt;&lt;font size="1"&gt;
&lt;p&gt;System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Reflection&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;BindingFlags&lt;/font&gt;&lt;font size="1"&gt; flags &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Reflection&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;BindingFlags&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Instance &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;|&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Reflection&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;BindingFlags&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;NonPublic &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;|&lt;/p&gt;&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Reflection&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;BindingFlags&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Public &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;|&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Reflection&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;BindingFlags&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Static;&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; 
&lt;p&gt;System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;Type&lt;/font&gt;&lt;font size="1"&gt; type &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; cpControl&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;GetType();&lt;/p&gt;System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;Reflection&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;PropertyInfo&lt;/font&gt;&lt;font size="1"&gt; p &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; type&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;GetProperty(&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;&amp;quot;CurrentView&amp;quot;&lt;/font&gt;&lt;font size="1"&gt;, flags);&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; 
&lt;p&gt;System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;ComponentModel&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;TypeConverter&lt;/font&gt;&lt;font size="1"&gt; converter &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; System&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;ComponentModel&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font color="#2b91af" size="1"&gt;TypeDescriptor&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;GetConverter(p&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;PropertyType);&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;object&lt;/font&gt;&lt;font size="1"&gt; result &lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;=&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt; converter&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;ConvertFrom(&lt;/font&gt;&lt;font color="#a31515" size="1"&gt;&amp;quot;ChangePassword&amp;quot;&lt;/font&gt;&lt;font size="1"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; p&lt;/font&gt;&lt;b&gt;&lt;font color="#0000ff" size="1"&gt;.&lt;/b&gt;&lt;/font&gt;&lt;font size="1"&gt;SetValue(cpControl, result, &lt;/font&gt;&lt;font color="#0000ff" size="1"&gt;null&lt;/font&gt;&lt;font size="1"&gt;);&lt;/font&gt;&lt;/font&gt;&lt;font size="1"&gt; 
&lt;p&gt;}&lt;/p&gt;&lt;/font&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1274484" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/egoldin/archive/tags/server+side/default.aspx">server side</category></item><item><title>Data Entry: Use Enter as Tab</title><link>http://msmvps.com/blogs/egoldin/archive/2007/07/30/data-entry-use-enter-as-tab.aspx</link><pubDate>Mon, 30 Jul 2007 20:25:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:1074043</guid><dc:creator>egoldin</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=1074043</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2007/07/30/data-entry-use-enter-as-tab.aspx#comments</comments><description>&lt;p&gt;A simple javascript will make your Enter key work as Tab. It is useful&amp;nbsp;in large tabular forms.&lt;/p&gt;
&lt;p&gt;function enterToTab(){&lt;br /&gt;&amp;nbsp; if (event.keyCode==13)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; event.keyCode=9;&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;input type=&amp;quot;text&amp;quot; onkeydown=&amp;quot;enterToTab()&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;Note using onkeydown event. Onkeypress won&amp;#39;t do the trick.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=1074043" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/egoldin/archive/tags/client+side/default.aspx">client side</category></item><item><title>Detect Vista on client machine</title><link>http://msmvps.com/blogs/egoldin/archive/2007/05/21/detect-vista-on-client-machine.aspx</link><pubDate>Mon, 21 May 2007 12:15:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:916620</guid><dc:creator>egoldin</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=916620</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2007/05/21/detect-vista-on-client-machine.aspx#comments</comments><description>&lt;p&gt;If you need to know if client&amp;#39;s browser runs on a Vista machine, run javascript &lt;br /&gt;navigator.userAgent &lt;br /&gt;or &lt;br /&gt;navigator.appVersion &lt;br /&gt;and search the returning string for &amp;quot;Windows NT 6.0&amp;quot;. If it is there, you are on Vista. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=916620" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/egoldin/archive/tags/client+side/default.aspx">client side</category></item><item><title>Silverlight is coming: c# calls from javascript and more...</title><link>http://msmvps.com/blogs/egoldin/archive/2007/05/08/silverlight-is-coming-c-calls-from-javascript-and-more.aspx</link><pubDate>Tue, 08 May 2007 15:28:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:894862</guid><dc:creator>egoldin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=894862</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2007/05/08/silverlight-is-coming-c-calls-from-javascript-and-more.aspx#comments</comments><description>&lt;p&gt;Soon you won&amp;#39;t need to go to the server to&amp;nbsp;treat your client-site javascript with some c# calls. &amp;nbsp;Watch this technology, it looks promising:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2007/05/07/silverlight.aspx" target="_blank"&gt;Silverlight&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Scott Guthrie:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Silverlight opens up a ton of opportunities to build significantly richer client experiences that run cross platform and cross browser.&amp;nbsp;&lt;br /&gt;For .NET developers, it means that you can now write .NET code using any development language (VB, C#, Javascript, Python, Ruby and more) in the web-browser (using Silverlight), web-server (using ASP.NET), in desktop applications, and with mobile devices.&amp;nbsp; You&amp;#39;ll be able to use great Visual Studio developer tools and Expression Studio designer tools to target&amp;nbsp;each of these experiences.&lt;/em&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=894862" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/egoldin/archive/tags/client+side/default.aspx">client side</category></item><item><title>Table height:100%</title><link>http://msmvps.com/blogs/egoldin/archive/2007/01/03/table-height-100.aspx</link><pubDate>Wed, 03 Jan 2007 12:45:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:466907</guid><dc:creator>egoldin</dc:creator><slash:comments>9</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=466907</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2007/01/03/table-height-100.aspx#comments</comments><description>Ever tried to get a &amp;lt;table&amp;gt; to take the whole browser height? Not a trivial task if you want to keep the browser in the Strict mode. Yes, removing &lt;FONT color=#0000ff size=1&gt;
&lt;P&gt;&amp;lt;!&lt;/FONT&gt;&lt;FONT color=#a31515 size=1&gt;DOCTYPE&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=1&gt;html&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=1&gt;PUBLIC&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/FONT&gt;&lt;FONT size=1&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=1&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;will do, but that's already the Quirks mode.&lt;/P&gt;
&lt;P&gt;This css rule will work even in the Strict mode:&lt;/P&gt;
&lt;P&gt;html, body, table#main {height: 100%}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=466907" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/egoldin/archive/tags/html/default.aspx">html</category></item><item><title>How to get DataTable out of SqlDataSource</title><link>http://msmvps.com/blogs/egoldin/archive/2006/12/27/how-to-get-datatable-out-of-sqldatasource.aspx</link><pubDate>Wed, 27 Dec 2006 19:29:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:454256</guid><dc:creator>egoldin</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=454256</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2006/12/27/how-to-get-datatable-out-of-sqldatasource.aspx#comments</comments><description>&lt;P&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;In many scenarios developers would like to combine the great simplicity of Asp.Net 2.0 declarative databinding with the same level of control over data as they get with good old traditional databinding. Sometimes the developers need to manipulate on the data in the datasource and thus to access it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;If the data come from a SQL Server database, you will use the SqlDataSource control. Setting the DataSourceMode property to DataSet will result in creating a DataSet object in the server memory. The object will be loaded with the data after running the Select method. The Select method returns a DataView populated with the rows returned from the database. Having obtained the DataView, you can easily convert it to a DataTable with the DataView.ToTable method.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;In the case of declarative databinding the Select method is called automatically by controls that are bound to the SqlDataSource and it is not obvious where is your chance to catch the datasource, convert it to a DataTable and do something on it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;If you need to access the dataset prior to databinding, you don’t have any choice but to call the Select manually, which contradicts the whole idea of declarative databinding. Too bad.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:Arial;"&gt;In some scenarios however you can first databind and then operate on the DataTable. One example is when you need to save the table for postbacks. In this case you can catch the table in the ItemDataBound or RowDataBound event of the control bound to the SqlDataSource. The event reaches the DataView via the DataItem property exposed by the data items:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;bool&lt;/SPAN&gt; firstTime = &lt;SPAN style="COLOR:blue;"&gt;true&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;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;System.Data.&lt;SPAN style="COLOR:teal;"&gt;DataTable&lt;/SPAN&gt; dt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; GridView1_RowDataBound(&lt;SPAN style="COLOR:blue;"&gt;object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR:teal;"&gt;GridViewRowEventArgs&lt;/SPAN&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&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;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;if&lt;/SPAN&gt; (e.Row.RowType == &lt;SPAN style="COLOR:teal;"&gt;DataControlRowType&lt;/SPAN&gt;.DataRow)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&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;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR:blue;"&gt;this&lt;/SPAN&gt;.firstTime)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&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;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&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;System.Data.&lt;SPAN style="COLOR:teal;"&gt;DataView&lt;/SPAN&gt; dv = &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (e.Row.DataItem &lt;SPAN style="COLOR:blue;"&gt;as&lt;/SPAN&gt; System.Data.&lt;SPAN style="COLOR:teal;"&gt;DataRowView&lt;/SPAN&gt;).DataView;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&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:blue;"&gt;this&lt;/SPAN&gt;.dt = dv.ToTable();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&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:blue;"&gt;this&lt;/SPAN&gt;.Label1.Text = dt.Rows.Count.ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&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:blue;"&gt;this&lt;/SPAN&gt;.firstTime = &lt;SPAN style="COLOR:blue;"&gt;false&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;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&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;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:8pt;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&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&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=454256" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/egoldin/archive/tags/server+side/default.aspx">server side</category></item><item><title>Programmatically determining the sqlDbType of a field</title><link>http://msmvps.com/blogs/egoldin/archive/2006/12/20/programmatically-determining-the-sqldbtype-of-a-field.aspx</link><pubDate>Wed, 20 Dec 2006 21:34:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:437727</guid><dc:creator>egoldin</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=437727</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2006/12/20/programmatically-determining-the-sqldbtype-of-a-field.aspx#comments</comments><description>&lt;P&gt;I found this remarkable info in a newsgroup post&amp;nbsp;from David Sceppa from Microsoft:&lt;/P&gt;
&lt;P&gt;You can build a SqlCommand to query the table and retrieve this schema information from the SqlDataReader through its GetSchemaTable method.&amp;nbsp; This method returns a DataTable of schema information.&amp;nbsp;Each row in the DataTable corresponds to a column in the resultset for the original query.&amp;nbsp;The DataTable of schema information includes columns for column name, data type, etc. There's a column called ProviderType that contains an integer, which you can cast to SqlDbType.&lt;BR&gt;&lt;BR&gt;Here's some code that should help:&lt;BR&gt;&lt;BR&gt;Visual Basic .NET:&lt;BR&gt;&amp;nbsp; Dim strConn, strSQL As String&lt;BR&gt;&amp;nbsp; strConn = "Data Source=(local)\NetSDK;Initial&amp;nbsp;Catalog=Northwind;" &amp;amp; _&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Trusted_Connection=Yes;"&lt;BR&gt;&amp;nbsp; Dim cn As New SqlConnection(strConn)&lt;BR&gt;&amp;nbsp; cn.Open()&lt;BR&gt;&amp;nbsp; strSQL = "SELECT OrderDate FROM Orders"&lt;BR&gt;&amp;nbsp; Dim cmd As New SqlCommand(strSQL, cn)&lt;BR&gt;&amp;nbsp; Dim rdr As SqlDataReader&lt;BR&gt;&amp;nbsp; rdr = cmd.ExecuteReader(CommandBehavior.SchemaOnly)&lt;BR&gt;&amp;nbsp; Dim tbl As DataTable = rdr.GetSchemaTable()&lt;BR&gt;&amp;nbsp; rdr.Close()&lt;BR&gt;&amp;nbsp; cn.Close()&lt;BR&gt;&amp;nbsp; Dim intOrderDateType As Integer&lt;BR&gt;&amp;nbsp; intOrderDateType = CType(tbl.Rows(0)("ProviderType"), Integer)&lt;BR&gt;&amp;nbsp; Dim typOrderDateType As SqlDbType&lt;BR&gt;&amp;nbsp; typOrderDateType = CType(intOrderDateType, SqlDbType)&lt;BR&gt;&amp;nbsp; Console.WriteLine("ProviderType = " &amp;amp; intOrderDateType)&lt;BR&gt;&amp;nbsp; Console.WriteLine("SqlDbType = " &amp;amp; typOrderDateType.ToString())&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;Visual C# .NET:&lt;BR&gt;&amp;nbsp; string strConn, strSQL;&lt;BR&gt;&amp;nbsp; strConn = @"Data Source=(local)\NetSDK;Initial Catalog=Northwind;" +&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Trusted_Connection=Yes;";&lt;BR&gt;&amp;nbsp; SqlConnection cn = new SqlConnection(strConn);&lt;BR&gt;&amp;nbsp; cn.Open();&lt;BR&gt;&amp;nbsp; strSQL = "SELECT OrderDate FROM Orders";&lt;BR&gt;&amp;nbsp; SqlCommand cmd = new SqlCommand(strSQL, cn);&lt;BR&gt;&amp;nbsp; SqlDataReader rdr;&lt;BR&gt;&amp;nbsp; rdr = cmd.ExecuteReader(CommandBehavior.SchemaOnly);&lt;BR&gt;&amp;nbsp; DataTable tbl = rdr.GetSchemaTable();&lt;BR&gt;&amp;nbsp; rdr.Close();&lt;BR&gt;&amp;nbsp; cn.Close();&lt;BR&gt;&amp;nbsp; int intOrderDateType;&lt;BR&gt;&amp;nbsp; intOrderDateType = (int) tbl.Rows[0]["ProviderType"];&lt;BR&gt;&amp;nbsp; SqlDbType typOrderDateType;&lt;BR&gt;&amp;nbsp; typOrderDateType = (SqlDbType) intOrderDateType;&lt;BR&gt;&amp;nbsp; Console.WriteLine("ProviderType = " + intOrderDateType);&lt;BR&gt;&amp;nbsp; Console.WriteLine("SqlDbType = " + typOrderDateType.ToString());&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=437727" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/egoldin/archive/tags/ado.net/default.aspx">ado.net</category></item><item><title>OWC is retiring</title><link>http://msmvps.com/blogs/egoldin/archive/2006/12/19/owc-is-retiring.aspx</link><pubDate>Tue, 19 Dec 2006 22:17:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:434957</guid><dc:creator>egoldin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=434957</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2006/12/19/owc-is-retiring.aspx#comments</comments><description>&lt;P&gt;For years OWC (stands for Office Web Components) has been serving to web developers as a power graphic engine. Free for non-interactive scenarios, it provides Excel-style charts.&lt;/P&gt;
&lt;P&gt;Now it is on the way out. OWC is being deprecated and will not receive any functionality updates (&lt;A href="http://blogs.msdn.com/excel/archive/2006/07/17/668544.aspx"&gt;http://blogs.msdn.com/excel/archive/2006/07/17/668544.aspx&lt;/A&gt;). Instead Microsoft will be offering a technology called Excel Services which is a part of Microsoft Office SharePoint Server 2007. It has been designed to scale and perform on a server. But&amp;nbsp;it as not going to be a replacement for OWC from the functionality perspective&amp;nbsp;and&amp;nbsp;it is not free anymore. &lt;/P&gt;
&lt;P&gt;Although technically nothing stop me from continuing using OWC in new projects and recommend it to others, I don't feel comfortable relying on a deprecated technology. Looks like I will rather need&amp;nbsp; to shop for a third party component.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=434957" width="1" height="1"&gt;</description><category domain="http://msmvps.com/blogs/egoldin/archive/tags/charting/default.aspx">charting</category></item><item><title>A foreword</title><link>http://msmvps.com/blogs/egoldin/archive/2006/12/07/a-foreword.aspx</link><pubDate>Thu, 07 Dec 2006 22:34:00 GMT</pubDate><guid isPermaLink="false">d67277c4-116b-43f1-b688-e9ef184ea916:402809</guid><dc:creator>egoldin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://msmvps.com/blogs/egoldin/rsscomments.aspx?PostID=402809</wfw:commentRss><comments>http://msmvps.com/blogs/egoldin/archive/2006/12/07/a-foreword.aspx#comments</comments><description>&lt;P&gt;The purpose of this blog is to share tips, tricks, patterns, thoughts on all aspects of asp.net development.&lt;/P&gt;
&lt;P&gt;Stay tuned!&lt;/P&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://msmvps.com/aggbug.aspx?PostID=402809" width="1" height="1"&gt;</description></item></channel></rss>