<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-2489715795736666279</id><updated>2012-02-16T15:45:25.301+05:30</updated><category term='Mobile'/><category term='Gradient Fill'/><category term='Visual Studio'/><category term='MVC'/><category term='CSS'/><category term='Screen Capture'/><category term='Lock folder'/><category term='Sql Server'/><category term='Date Time formats'/><category term='Shortcuts'/><category term='MyMobiler'/><category term='Csv'/><category term='C#.NET'/><category term='Restore Database'/><category term='.Net CE 3.5'/><category term='ASP.NET'/><category term='Conversion formats'/><category term='SEO'/><category term='OLEDB'/><category term='COALESCE'/><category term='Firefox with in firefox'/><category term='.net'/><category term='Windows Service'/><category term='MS DOS'/><category term='Windows CE'/><category term='Tips and Tricks'/><category term='Entity Framework'/><category term='Excel'/><title type='text'>GOPI's PORTAL</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-1479752442152679809</id><published>2012-02-14T11:09:00.005+05:30</published><updated>2012-02-14T11:17:13.884+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='SEO'/><category scheme='http://www.blogger.com/atom/ns#' term='C#.NET'/><title type='text'>SEO: Adding Meta Tags to ASPX Page Programmatically</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Adding page-specific meta tags, like "Description" and "Keywords" is very important in SEO optimization. Meta tags could be added directly to the head section of the web pages, such as .html or plain .aspx,but it is less than trivial in case of .aspx page referring masterpage because the head section is included in master page, so by default all pages referring to it will share the same set of meta tags.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;"&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlmeta.aspx" target="_blank"&gt;&lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;&lt;/a&gt;"&lt;/b&gt; is a class available in &lt;b&gt;"&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ui.htmlcontrols(v=vs.80).aspx" target="_blank"&gt;&lt;span style="color: #45818e;"&gt;System.Web.UI.HtmlControls&lt;/span&gt;&lt;/a&gt;"&lt;/b&gt; namespace, which allows to add page-specific meta tags to the .aspx pages referring the same masterpage from code behind.Following is the example for how to use this class This code snippet should be included in Page_Load event of.aspx page.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlHead&lt;/span&gt; head = (&lt;span style="color: #45818e;"&gt;HtmlHead&lt;/span&gt;)Page.Header;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt; oMeta1 = new &lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;();&lt;br /&gt;oMeta1.Name = &lt;span style="color: #cc0000;"&gt;"Description"&lt;/span&gt;;&lt;br /&gt;oMeta1.Content =&lt;span style="color: #cc0000;"&gt; "this is the Page description"&lt;/span&gt;;&lt;br /&gt;head.Controls.Add(oMeta1);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;&amp;nbsp;oMeta2 = new&amp;nbsp;&lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;();&lt;br /&gt;oMeta2.Name = &lt;span style="color: #cc0000;"&gt;"Keywords"&lt;/span&gt;;&lt;br /&gt;oMeta2.Content = &lt;span style="color: #cc0000;"&gt;"Keyword1,Keyword2...."&lt;/span&gt;;&lt;br /&gt;head.Controls.Add(oMeta2);&lt;br /&gt;&lt;br /&gt;For example if one page deals with .NET Articals, and another page deals with Java artical and both sharing the same master page, then code snippets are like below.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: orange;"&gt;For .NET Articles Page&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlHead&lt;/span&gt;&amp;nbsp;head = (&lt;span style="color: #45818e;"&gt;HtmlHead&lt;/span&gt;)Page.Header; &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;&amp;nbsp;oMeta1 = new&amp;nbsp; &lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;();&lt;br /&gt;oMeta1.Name = &lt;span style="color: #cc0000;"&gt;"Description"&lt;/span&gt;;&lt;br /&gt;oMeta1.Content = &lt;span style="color: #cc0000;"&gt;"this is the .NET Page description&lt;/span&gt;&lt;span style="color: red;"&gt;"&lt;/span&gt;;&lt;br /&gt;head.Controls.Add(oMeta1);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;&amp;nbsp;oMeta2 = new&amp;nbsp; &lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;();&lt;br /&gt;oMeta2.Name = &lt;span style="color: #cc0000;"&gt;"Keywords"&lt;/span&gt;;&lt;br /&gt;oMeta2.Content =&lt;span style="color: #cc0000;"&gt; "C#.NET,ASP.NET,Ajax,VB.NET,OOPs,Microsoft"&lt;/span&gt;;&lt;br /&gt;head.Controls.Add(oMeta2);&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: orange;"&gt;For Java Articles Page&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlHead&lt;/span&gt;&amp;nbsp;head = (&lt;span style="color: #45818e;"&gt;HtmlHead&lt;/span&gt;)Page.Header; &lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;&amp;nbsp;oMeta1 = new&amp;nbsp; &lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;();&lt;br /&gt;oMeta1.Name = &lt;span style="color: #cc0000;"&gt;"Description"&lt;/span&gt;;&lt;br /&gt;oMeta1.Content = &lt;span style="color: #cc0000;"&gt;"this is the Java Page description"&lt;/span&gt;;&lt;br /&gt;head.Controls.Add(oMeta1);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;&amp;nbsp;oMeta2 = new&amp;nbsp; &lt;span style="color: #45818e;"&gt;HtmlMeta&lt;/span&gt;();&lt;br /&gt;oMeta2.Name = &lt;span style="color: #cc0000;"&gt;"Keywords"&lt;/span&gt;;&lt;br /&gt;oMeta2.Content = &lt;span style="color: #cc0000;"&gt;"Java,Oracle,Sun,OOPs,J2EE"&lt;/span&gt;;&lt;br /&gt;head.Controls.Add(oMeta2);&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-1479752442152679809?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/1479752442152679809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2012/02/seo-adding-meta-tags-to-aspx-page.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/1479752442152679809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/1479752442152679809'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2012/02/seo-adding-meta-tags-to-aspx-page.html' title='SEO: Adding Meta Tags to ASPX Page Programmatically'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-3140928293050900313</id><published>2011-12-14T10:28:00.000+05:30</published><updated>2011-12-14T10:28:03.912+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#.NET'/><title type='text'>Convert String into Title Case</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;To convert a string into title case, use the following code&lt;br /&gt;&lt;br /&gt;System.Globalization.TextInfo objTextInfo = new System.Globalization.CultureInfo("en-US").TextInfo;&lt;br /&gt;objTextInfo.ToTitleCase(sString.ToLower());&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-3140928293050900313?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/3140928293050900313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/12/convert-string-into-title-case.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/3140928293050900313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/3140928293050900313'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/12/convert-string-into-title-case.html' title='Convert String into Title Case'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-2301403003013604468</id><published>2011-11-25T14:41:00.000+05:30</published><updated>2011-11-25T14:41:46.111+05:30</updated><title type='text'>Now Listen Posts From Gopi's Portal</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Hi All!&lt;br /&gt;Are you feel boring to read posts, No problem from now on, you can listen posts instead of reading. While listening, you can do other tasks as well. You can navigate posts by clicking on Next and Previous buttons. Check it:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-wS5otxW4G1U/Ts9ZBukPmRI/AAAAAAAAAZo/lHr1vFJu89c/s1600/Podcast.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="256" src="http://4.bp.blogspot.com/-wS5otxW4G1U/Ts9ZBukPmRI/AAAAAAAAAZo/lHr1vFJu89c/s320/Podcast.gif" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Verdana;"&gt;&lt;span class="Apple-style-span" style="font-size: 12px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;Thanks to &lt;b&gt;&lt;a href="http://www.ispeech.org/" target="_blank"&gt;&lt;span class="Apple-style-span" style="color: #45818e;"&gt;iSpeech&lt;/span&gt;&lt;/a&gt;&lt;/b&gt; for giving this wonderful gadget.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-2301403003013604468?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/2301403003013604468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/11/now-listen-posts-from-gopis-portal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/2301403003013604468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/2301403003013604468'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/11/now-listen-posts-from-gopis-portal.html' title='Now Listen Posts From Gopi&apos;s Portal'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-wS5otxW4G1U/Ts9ZBukPmRI/AAAAAAAAAZo/lHr1vFJu89c/s72-c/Podcast.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-7086940031673019838</id><published>2011-11-25T14:06:00.000+05:30</published><updated>2011-11-25T14:06:20.869+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><title type='text'>Search in All Stored Procedures of a Database</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Some times to search for all the Stored Procedures having a given text in its definition. Then we can query like below to get the results&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT &lt;/span&gt;OBJECT_NAME(object_id), OBJECT_DEFINITION(object_id)&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM &lt;/span&gt;sys.procedures&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;WHERE &lt;/span&gt;OBJECT_DEFINITION(object_id) &lt;span class="Apple-style-span" style="color: blue;"&gt;LIKE &lt;/span&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;'%SearchWord%'&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-7086940031673019838?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/7086940031673019838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/11/search-in-all-stored-procedures-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/7086940031673019838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/7086940031673019838'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/11/search-in-all-stored-procedures-of.html' title='Search in All Stored Procedures of a Database'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-7002200828480012291</id><published>2011-10-31T10:50:00.010+05:30</published><updated>2011-10-31T13:04:29.990+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='C#.NET'/><title type='text'>How to debug Windows Service Without installing it</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;While developing a Windows service if you want to debug or run it will give you the following message.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;"Cannot start service from the command line or a debugger.A Windows Service must first be installed (using installutil.exe)&amp;nbsp;and then started with the ServerExplorer, Windows Services&amp;nbsp;Administrative tool or the NET START command."&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;So for debugging you first install the service, but it is a long process because every time you make changes, you need to reinstall your service and debug it again.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;Here is the solution for avoiding this long process.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span"&gt;For&amp;nbsp;&lt;/span&gt;debugging your service without installing it, make changes in Program.cs like this.&lt;br /&gt;Suppose if your Program.cs file is&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;static &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #6fa8dc;"&gt;Program&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;static &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt; Main()&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ServiceBase[] ServicesToRun;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ServicesToRun = new ServiceBase[]&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;{&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt; &amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;new &lt;/span&gt;MyWindowsService()&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;};&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ServiceBase.Run(ServicesToRun);&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Change the above code like below&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;static &lt;/span&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #6fa8dc;"&gt;Program&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="color: blue;"&gt;static &lt;/span&gt;&lt;span style="color: blue;"&gt;void&lt;/span&gt; Main()&lt;br /&gt;&amp;nbsp; &amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;#if&lt;/span&gt;(!DEBUG)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style="color: #999999;"&gt;ServiceBase[] ServicesToRun;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #999999;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ServicesToRun =&lt;/span&gt;&lt;span style="color: #999999;"&gt; new&lt;/span&gt;&lt;span style="color: #999999;"&gt; ServiceBase[]&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span style="color: #999999;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #999999;"&gt; &amp;nbsp; {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span style="color: #999999;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #999999;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span style="color: #999999;"&gt;new&amp;nbsp;&lt;/span&gt;&lt;span style="color: #999999;"&gt;MyWindowsService()&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span style="color: #999999;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #999999;"&gt; &amp;nbsp; };&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #999999;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ServiceBase.Run(ServicesToRun);&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style="color: blue;"&gt;#else&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;MyWindowsService&amp;nbsp;myWindowsServ = &lt;span class="Apple-style-span" style="color: blue;"&gt;new&amp;nbsp;&lt;/span&gt;MyWindowsService();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;myWindowsServ.RunService();&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;&amp;nbsp;#endif&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Here&amp;nbsp;RunService&amp;nbsp;is My Service function that initiates the OnStart Event of the Service.&lt;br /&gt;&lt;br /&gt;Now if you run your service then it will not show you the above message. It simply runs the service. Now you can debug you application by simply adding the breakpoints.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-7002200828480012291?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/7002200828480012291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/10/how-to-debug-windows-service-without.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/7002200828480012291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/7002200828480012291'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/10/how-to-debug-windows-service-without.html' title='How to debug Windows Service Without installing it'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-4242632875922798595</id><published>2011-10-24T17:05:00.000+05:30</published><updated>2011-10-24T17:06:02.743+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Change Model's value in View on Postback</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In MVC, if you change any value of the model in the postback action, it won't reflect in the View when it is redisplayed. It is because of the design of the HTML Helpers.&lt;br /&gt;&lt;br /&gt;For example, if you have a view like below&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;&amp;lt;%&lt;/span&gt; using (Html.BeginForm()) { &lt;span class="Apple-style-span" style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;span class="Apple-style-span" style="background-color: yellow;"&gt;&amp;lt;%=&lt;/span&gt; Html.TextBoxFor(m =&amp;gt; m.FirstName)&amp;nbsp;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt; &amp;lt;%=&lt;/span&gt; Html.TextBoxFor(m =&amp;gt; m.LastName)&amp;nbsp;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;input type="submit" value="OK" /&amp;gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;&amp;lt;% &lt;/span&gt;}&amp;nbsp;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;which you are posting to the following action:&lt;br /&gt;&lt;br /&gt;[&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;HttpPost&lt;/span&gt;]&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;ActionResult&lt;/span&gt;&amp;nbsp;Sample(&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;SampleModel&lt;/span&gt;&amp;nbsp;model)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; model.FirstName = "&lt;span class="Apple-style-span" style="color: red;"&gt;Krish&lt;/span&gt;";&lt;br /&gt;&amp;nbsp; &amp;nbsp; model.LastName = "&lt;span class="Apple-style-span" style="color: red;"&gt;S&lt;/span&gt;";&lt;br /&gt;&amp;nbsp; &amp;nbsp; return View(model);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Here the 'FirstName' Property of the model is changed in the Action. But, when the view is redisplayed the old value will be used.&lt;br /&gt;&lt;br /&gt;To avoid this remove the value from the 'ModelState'.So it will rebuild the control agin in the view with new data.&lt;br /&gt;&lt;br /&gt;[&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;HttpPost&lt;/span&gt;]&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;public&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;ActionResult&lt;/span&gt; Sample(&lt;span class="Apple-style-span" style="color: #6fa8dc;"&gt;SampleModel&lt;/span&gt; model)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; ModelState.Remove("&lt;span class="Apple-style-span" style="color: red;"&gt;FirstName&lt;/span&gt;");&lt;br /&gt;&amp;nbsp; &amp;nbsp; ModelState.Remove("&lt;span class="Apple-style-span" style="color: red;"&gt;LastName&lt;/span&gt;");&lt;br /&gt;&amp;nbsp; &amp;nbsp; model.FirstName = "&lt;span class="Apple-style-span" style="color: red;"&gt;Krish&lt;/span&gt;";&lt;br /&gt;&amp;nbsp; &amp;nbsp; model.LastName = "&lt;span class="Apple-style-span" style="color: red;"&gt;S&lt;/span&gt;";&lt;br /&gt;&amp;nbsp; &amp;nbsp; return View(model);&lt;br /&gt;}&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-4242632875922798595?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/4242632875922798595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/10/change-models-value-in-view-on-postback.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/4242632875922798595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/4242632875922798595'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/10/change-models-value-in-view-on-postback.html' title='Change Model&apos;s value in View on Postback'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-6801905422848984628</id><published>2011-10-19T20:53:00.004+05:30</published><updated>2011-10-19T20:56:05.958+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Excel'/><category scheme='http://www.blogger.com/atom/ns#' term='OLEDB'/><category scheme='http://www.blogger.com/atom/ns#' term='C#.NET'/><title type='text'>Extended Properties for Excel Connection String</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;While Reading from Excel, we have two properties which help us to read correct data from excel sheet. Those are&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;HDR&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;"HDR=Yes;" indicates that the first row contains columnnames, not data. "HDR=No;" indicates the opposite.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;IMEX&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;"IMEX=1;" tells the driver to always read "intermixed" (numbers, dates, strings etc) data columns as text.&lt;br /&gt;Note that this option might affect excel sheet write access negative.&lt;br /&gt;&lt;br /&gt;Below is the Connection string to read from Excel sheet, which shows the usage of the above&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #e06666;"&gt;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 12.0;HDR=Yes;IMEX=1";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I.e. excel worksheet name followed by a "$" and wrapped in "[" "]" brackets.&lt;br /&gt;&lt;br /&gt;While reading from excel sheet, by default it uses only the first 8 rows to guess the column datatype.&lt;br /&gt;We can change this&amp;nbsp;behavior&amp;nbsp;by setting the value 0 to the registry key&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #e06666;"&gt;[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Jet\4.0\Engines\Excel] located registry REG_DWORD "TypeGuessRows"&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;This might hurt performance.&lt;br /&gt;Please also note that adding the IMEX=1 option might cause the IMEX feature to set in after just 8 rows. Use IMEX=0 instead to be sure to force the registry TypeGuessRows=0 (scan all rows) to work.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-6801905422848984628?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/6801905422848984628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/10/extended-properties-for-excel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/6801905422848984628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/6801905422848984628'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/10/extended-properties-for-excel.html' title='Extended Properties for Excel Connection String'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-5135394155424320886</id><published>2011-10-14T15:41:00.004+05:30</published><updated>2011-10-20T16:08:59.261+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVC'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Conditionally disable a Control in ASP.NET MVC</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;In MVC, you can disable a control based on some property from the model using the following&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;&amp;lt;%:&lt;/span&gt; Html.TextBoxFor(m =&amp;gt; m.date2,Model.VoiceMessage?&lt;span class="Apple-style-span" style="color: blue;"&gt; null&lt;/span&gt;:&lt;span class="Apple-style-span" style="color: blue;"&gt; new&lt;/span&gt; { @disabled = &lt;span class="Apple-style-span" style="color: blue;"&gt;true&lt;/span&gt; })&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here, I am disabling the textbox based on the "VoiceMessage" field. It adds the&amp;nbsp;"disabled" attribute, if "VoiceMessage" value is false.&lt;br /&gt;If any other attributes are present then you can write like &amp;nbsp;below&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;&amp;lt;%:&lt;/span&gt; Html.TextBoxFor(m =&amp;gt; m.date2, Model.VoiceMessage?(&lt;span class="Apple-style-span" style="color: blue;"&gt;object&lt;/span&gt;) &lt;span class="Apple-style-span" style="color: blue;"&gt;new&lt;/span&gt; { @id = "textbox1" } : (&lt;span class="Apple-style-span" style="color: blue;"&gt;object&lt;/span&gt;)&lt;span class="Apple-style-span" style="color: blue;"&gt;new&lt;/span&gt; { @id = "textbox1",@disabled=&lt;span class="Apple-style-span" style="color: blue;"&gt;true&lt;/span&gt; })&lt;span class="Apple-style-span" style="background-color: yellow;"&gt;%&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-5135394155424320886?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/5135394155424320886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/10/conditionally-disable-control-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/5135394155424320886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/5135394155424320886'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/10/conditionally-disable-control-in-aspnet.html' title='Conditionally disable a Control in ASP.NET MVC'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-8732860922532698287</id><published>2011-10-13T15:45:00.001+05:30</published><updated>2011-10-13T15:45:49.742+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='C#.NET'/><title type='text'>Detect Web Request device for Mobile</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;Today most of the websites have mobile websites. Hence when mobile users go to main webpage,it should be redirected to their mobile site.&lt;br /&gt;So we need to write a small piece of code in main webpage to detect whether the user is from PC or mobile device .If the user is detected to be from mobile, we can redirect to its corresponding mobile website. We can detect it using the "HTTP_USER_AGENT" data available in the user agent.&lt;br /&gt;Below C#.net snippet checks whether the user is from mobile or PC&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;string&lt;/span&gt; u = Request.ServerVariables[&lt;span class="Apple-style-span" style="color: red;"&gt;"HTTP_USER_AGENT"&lt;/span&gt;];&lt;br /&gt;&lt;br /&gt;System.Text.RegularExpressions.&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;Regex&lt;/span&gt; browser = &lt;span class="Apple-style-span" style="color: blue;"&gt;new&lt;/span&gt; System.Text.RegularExpressions.&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;Regex&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: red;"&gt;@"android|avantgo|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|phone)|xda|xiino"&lt;/span&gt;,&amp;nbsp;System.Text.RegularExpressions.&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;RegexOptions&lt;/span&gt;.IgnoreCase | System.Text.RegularExpressions.&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;RegexOptions&lt;/span&gt;.Multiline);&lt;br /&gt;&lt;br /&gt;System.Text.RegularExpressions.&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;Regex&lt;/span&gt; agent = &lt;span class="Apple-style-span" style="color: blue;"&gt;new&lt;/span&gt; System.Text.RegularExpressions.&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;Regex&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: red;"&gt;@"1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r|s)|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|e\\-|e\\/|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g|nc|nw)|wmlb|wonu|x700|xda(\\-|2|g)|yas\\-|your|zeto|zte\\-"&lt;/span&gt;, System.Text.RegularExpressions.&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;RegexOptions&lt;/span&gt;.IgnoreCase |&amp;nbsp;System.Text.RegularExpressions.&lt;span class="Apple-style-span" style="color: #3d85c6;"&gt;RegexOptions&lt;/span&gt;.Multiline);&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;if&lt;/span&gt; ((browser.IsMatch(u) || agent.IsMatch(u.Substring(0, 4))))&lt;br /&gt;&amp;nbsp;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Response.Redirect(&lt;span class="Apple-style-span" style="color: red;"&gt;"Mobile Site address"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Response.Redirect(&lt;span class="Apple-style-span" style="color: red;"&gt;"PC Site address"&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-8732860922532698287?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/8732860922532698287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/10/detect-web-request-device-for-mobile.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/8732860922532698287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/8732860922532698287'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/10/detect-web-request-device-for-mobile.html' title='Detect Web Request device for Mobile'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-4419590503966812405</id><published>2011-05-26T14:01:00.000+05:30</published><updated>2011-05-26T14:01:44.260+05:30</updated><title type='text'>Query to Find Column From All Tables of Database</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;br /&gt;Sometimes we need to find whether a column exists in any of the table in the entire database. If the tables count is smaller like 10 or 20, then we can find it with in few seconds or minutes. But if count is very large and each table has many no of columns then it becomes takes long time.&lt;br /&gt;&lt;br /&gt;The following query returns all the table names in the database which have the given column name with in few seconds.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;USE&lt;/span&gt; &amp;nbsp;dbName&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;GO&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt; &lt;span class="Apple-style-span" style="color: magenta;"&gt;SCHEMA_NAME&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: magenta;"&gt;schema_id&lt;/span&gt;) &lt;span class="Apple-style-span" style="color: blue;"&gt;AS&lt;/span&gt; SchemaName&lt;br /&gt;,T.name&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;AS&lt;/span&gt;&amp;nbsp;TableName&lt;br /&gt;,C.name&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;AS&lt;/span&gt;&amp;nbsp;ColumnName&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #6aa84f;"&gt;sys.tables&lt;/span&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;AS&lt;/span&gt;&amp;nbsp;T&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #666666;"&gt;INNER JOIN&lt;/span&gt; &lt;span class="Apple-style-span" style="color: #38761d;"&gt;sys.columns&lt;/span&gt; C &lt;span class="Apple-style-span" style="color: blue;"&gt;ON&lt;/span&gt; T.&lt;span class="Apple-style-span" style="color: magenta;"&gt;OBJECT_ID&lt;/span&gt; = C.&lt;span class="Apple-style-span" style="color: magenta;"&gt;OBJECT_ID&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;WHERE&lt;/span&gt; C.name=&lt;span class="Apple-style-span" style="color: red;"&gt;'ColumnName'&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;ORDER BY&lt;/span&gt; SchemaName, TableName,C.column_id;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-4419590503966812405?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/4419590503966812405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/05/query-to-find-column-from-all-tables-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/4419590503966812405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/4419590503966812405'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/05/query-to-find-column-from-all-tables-of.html' title='Query to Find Column From All Tables of Database'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-1738893520590737132</id><published>2011-01-19T17:36:00.000+05:30</published><updated>2011-01-19T17:36:51.974+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Restore Database'/><title type='text'>Restore a Database from the SQL Command</title><content type='html'>Assume your Database "SampleDB" has full backup SampleDB.bak. It can be restored using following steps. Run this queries in the maste database.&lt;br /&gt;&lt;br /&gt;1) Retrive the Logical file name of the database from backup.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;RESTORE&lt;/span&gt; FILELISTONLY&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM DISK =&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;'E:SampleDBBackupfile.bak'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;2) Use the values in the LogicalName Column in following Step.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- Make Database to single user Mode&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;ALTER DATABASE&lt;/span&gt; SampleDB&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SET&lt;/span&gt; SINGLE_USER &lt;span class="Apple-style-span" style="color: blue;"&gt;WITH&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;ROLLBACK&lt;/span&gt; IMMEDIATE&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- Restore Database&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;RESTORE DATABASE&lt;/span&gt; SampleDB&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM DISK =&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;'E:SampleDBBackupfile.bak'&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;WITH MOVE&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;'MDFLogicalName'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: blue;"&gt;TO&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;'D:SampleDBDataFile.mdf'&lt;/span&gt;,&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;MOVE&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;'LDFLogicalName'&lt;/span&gt; &lt;span class="Apple-style-span" style="color: blue;"&gt;TO&lt;/span&gt; &lt;span class="Apple-style-span" style="color: red;"&gt;'D:SampleDBLDFFile.ldf'&lt;/span&gt;,&lt;br /&gt;&lt;span class="Apple-style-span" style="color: magenta;"&gt;REPLCE&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;/* Please run below statement if any error occures in the above Statement */&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- Convert Database again to Multi User Mode&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;ALTER DATABASE&lt;/span&gt;&amp;nbsp;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;SampleDB&amp;nbsp;&lt;/span&gt;SET MULTI_USER&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the above RESTORE Statement &lt;span class="Apple-style-span" style="color: red;"&gt;'MDFLogicalName'&lt;/span&gt; and &lt;span class="Apple-style-span" style="color: red;"&gt;'LDFLogicalName'&lt;/span&gt; are the logical names of the backup file which can be retrived from Step 1.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: red;"&gt;'D:SampleDBDataFile.mdf'&lt;/span&gt;&amp;nbsp;and&amp;nbsp;&lt;span class="Apple-style-span" style="color: red;"&gt;'D:SampleDBLDFFile.ldf'&lt;/span&gt; are the physical File paths for the SampleDB.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Reference&lt;/b&gt; :&amp;nbsp;&lt;a href="http://blog.sqlauthority.com/2007/02/25/sql-server-restore-database-backup-using-sql-script-t-sql/"&gt;blog.sqlauthority.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-1738893520590737132?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/1738893520590737132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2011/01/restore-database-from-sql-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/1738893520590737132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/1738893520590737132'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2011/01/restore-database-from-sql-command.html' title='Restore a Database from the SQL Command'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-5953031491964274988</id><published>2010-12-28T14:17:00.001+05:30</published><updated>2011-01-19T17:40:22.775+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='Entity Framework'/><title type='text'>Adding Parameter dynamically to the Entity Framework query</title><content type='html'>We can pass the parameters dynamically to a entity framework where clause. Below is the code snippet for passing the parameters dynamically...&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;//Declare the instances for the Entities and ObjectParameter collection&lt;/span&gt;&lt;br /&gt;MTEntities objMT = new MTEntities();&lt;br /&gt;List&lt;objectparameter&gt; ob = new List&lt;objectparameter&gt;();&lt;/objectparameter&gt;&lt;/objectparameter&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;//Declare the query holder variable&lt;/span&gt;&lt;br /&gt;&amp;nbsp;string strDyn = "";&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;//Build the query based on the selected used inputs&lt;/span&gt;&lt;br /&gt;if(txtName.text !="")&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;strDyn += "it.Organization =@Organization";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;//Add the object parameter into the collection&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;ob.Add(new ObjectParameter("Organization", txtName.Text));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;if(txtGuide.Text != "")&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;strDyn = strDyn.Length == 0 ? strDyn + "And" : strDyn;&lt;br /&gt;&amp;nbsp;strDyn += "it.CityName= @city";&lt;br /&gt;&amp;nbsp;ob.Add(New ObjectParameter("city", txtCity.Text));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;// repeat the above if block for all the parameters you need to pass to the query&lt;/span&gt;&lt;br /&gt;if (strDyn.Length &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;if (strDyn.EndsWith("And"))&lt;br /&gt;strDyn = strDyn.Remove(strDyn.Length, -3); &amp;nbsp;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;//Removes the Last 'And'&lt;/span&gt;&lt;br /&gt;var query = objMT.MT_tblOrganizations.Where(strDyn, ob.ToArray()).Select(O =&amp;gt; new { O.CreatedDate, O.OrganizationID, O.Organization, O.Verticals, O.Offerings, O.WebsiteURL});&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;//Execute and assign the result to the gridview&lt;/span&gt;&lt;br /&gt;MyGridview.DataSource = query;&lt;br /&gt;MyGridview.DataBind();&lt;br /&gt;}&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-5953031491964274988?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/5953031491964274988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/12/adding-parameter-dynamically-to-entity.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/5953031491964274988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/5953031491964274988'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/12/adding-parameter-dynamically-to-entity.html' title='Adding Parameter dynamically to the Entity Framework query'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-6002847182319148930</id><published>2010-12-14T11:29:00.004+05:30</published><updated>2011-10-20T16:15:02.900+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='CSS'/><category scheme='http://www.blogger.com/atom/ns#' term='Gradient Fill'/><title type='text'>Gradient Fill Style for buttons and backgrounds</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;We can apply Gradient Style for the Buttons and backgrounds easily.&lt;br /&gt;&lt;br /&gt;Just add the below style to your application.&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;It is working fine in IE, Mozilla Firfox and Google chrome&lt;/div&gt;&lt;br /&gt;.GradientFill&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FdE0c0', endColorstr='#ffffff'); /* for IE */&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;background: -webkit-gradient(linear, left top, left bottom, from(#FdE0c0), to(#fff)); /* for webkit browsers */&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;background: -moz-linear-gradient(top, &amp;nbsp;#FdE0c0, &amp;nbsp;#fff); /* for firefox 3.6+ */&lt;br /&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-6002847182319148930?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/6002847182319148930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/12/gradient-fill-style-for-buttons-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/6002847182319148930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/6002847182319148930'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/12/gradient-fill-style-for-buttons-and.html' title='Gradient Fill Style for buttons and backgrounds'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-469817120474224964</id><published>2010-09-25T15:12:00.003+05:30</published><updated>2011-10-20T16:12:30.205+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>ASP.NET Security Vulnerability found</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;According to &lt;a href="http://www.microsoft.com/technet/security/advisory/2416728.mspx"&gt;&lt;span style="color: blue;"&gt;Microsoft Security Advisory ,&lt;/span&gt; &lt;/a&gt;"Microsoft is investigating a new public report of a vulnerability in ASP.NET. An attacker who exploited this vulnerability could view data, such as the View State, which was encrypted by the target server, or read data from files on the target server, such as web.config. This would allow the attacker to tamper with the contents of the data. By sending back the altered contents to an affected server, the attacker could observe the error codes returned by the server."&lt;br /&gt;&lt;b&gt;Please check the below links for more information about this.&lt;/b&gt;&lt;br /&gt;&lt;span id="goog_468373799"&gt;&lt;/span&gt;1 ) &lt;a href="http://weblogs.asp.net/scottgu/archive/2010/09/18/important-asp-net-security-vulnerability.aspx" style="color: blue;"&gt;Important: ASP.NET Security Vulnerability&lt;/a&gt;&lt;span id="goog_468373800"&gt;&lt;/span&gt; &lt;br /&gt;2) &lt;a href="http://blogs.technet.com/b/srd/archive/2010/09/17/understanding-the-asp-net-vulnerability.aspx" style="color: blue;"&gt;Understanding the ASP.NET Vulnerability&lt;/a&gt;&lt;br /&gt;3) &lt;a href="http://pentonizer.com/general-programming/aspnet-poet-vulnerability-what-else-can-i-do/"&gt;&lt;span style="color: blue;"&gt;ASP.NET POET Vulnerability - What Else Can I Do?&lt;/span&gt; &lt;/a&gt;&lt;br /&gt;4) &lt;a href="http://www.dotnetnuke.com/Community/Blogs/tabid/825/EntryId/2799/Oracle-Padding-Vulnerability-in-ASP-NET.aspx" style="color: blue;"&gt;Oracle Padding Vulnerability in ASP.NET&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-469817120474224964?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/469817120474224964/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/09/aspnet-security-vulnerability-found.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/469817120474224964'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/469817120474224964'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/09/aspnet-security-vulnerability-found.html' title='ASP.NET Security Vulnerability found'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-9214357931463289591</id><published>2010-09-14T11:54:00.019+05:30</published><updated>2010-09-14T12:15:37.866+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Shortcuts'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Visual Studio Keyboard Shortcut Posters</title><content type='html'>Here is a collection of .NET Framework and Visual Studio Posters available for free. The .NET Framework posters can be used to find important class library details and relationships in the .NET Framework.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Visual C# Shortcut Posters&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=C15D210D-A926-46A8-A586-31F8A2E576FE&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Visual Studio 2005 Shortcuts&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=E5F902A8-5BB5-4CC6-907E-472809749973&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Visual Studio 2008 Shortcuts&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=92CED922-D505-457A-8C9C-84036160639F&amp;amp;displaylang=en"&gt;Visual Studio 2010 Shortcuts&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Visual Basic Shortcut Posters&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6bb41456-9378-4746-b502-b4c5f7182203&amp;amp;DisplayLang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Visual Studio 2005 Shortcuts&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=255B8CF1-F6BD-4B55-BB42-DD1A69315833&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Visual Studio 2008 Shortcuts&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=92CED922-D505-457A-8C9C-84036160639F&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Visual Studio 2010 Shortcuts&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;u&gt;Visual C++ Shortcut Posters&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=BCCF84F4-4136-48B2-B4EC-83EAA484DA20&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Visual Studio 2005 Shortcuts&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=4411BBFC-0E3C-42B3-BD05-AF1D292C986F&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Visual Studio 2008 Shortcuts&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=92CED922-D505-457A-8C9C-84036160639F&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Visual Studio 2010 Shortcuts&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;b&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7B645F3A-6D22-4548-A0D8-C2A27E1917F8&amp;amp;displaylang=fr&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;.NET Framework 3.5 Common Namespaces and Types Poster&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7B645F3A-6D22-4548-A0D8-C2A27E1917F8&amp;amp;displaylang=fr&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;:&lt;/span&gt; &lt;/a&gt;The .NET Framework 3.5 Common Namespaces and Types Poster is downloadable as XPS or PDF format.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=DFBF523C-F98C-4804-AFBD-459E846B268E&amp;amp;displaylang=en"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;C# Language Specification 4.0&lt;/span&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;:&lt;/span&gt;&lt;/b&gt;&amp;nbsp;It is the Word document containing all the basic specifications of C# Language.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;Thanks!..&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-9214357931463289591?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/9214357931463289591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/09/visual-studio-keyboard-shortcut-posters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/9214357931463289591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/9214357931463289591'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/09/visual-studio-keyboard-shortcut-posters.html' title='Visual Studio Keyboard Shortcut Posters'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-2213069752683174376</id><published>2010-09-09T19:03:00.011+05:30</published><updated>2011-10-31T13:01:12.240+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='Screen Capture'/><category scheme='http://www.blogger.com/atom/ns#' term='MyMobiler'/><title type='text'>View your mobile screen on your desktop</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Check the below link to view your mobile screen on your desktop.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Lucida Grande&amp;quot;, &amp;quot;Geneva&amp;quot;, &amp;quot;Verdana&amp;quot;, &amp;quot;Arial&amp;quot;, sans-serif; font-size: small;"&gt;&lt;b&gt;&lt;a href="http://www.mymobiler.com/"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;MyMobiler&lt;/span&gt;&lt;/a&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: &amp;quot;Lucida Grande&amp;quot;, &amp;quot;Geneva&amp;quot;, &amp;quot;Verdana&amp;quot;, &amp;quot;Arial&amp;quot;, sans-serif; font-size: small;"&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;a href="http://www.mymobiler.com/"&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;By using this tool, you can&lt;br /&gt;&lt;br /&gt;&lt;ul style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; color: #333333; font-size: 12px;"&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;View your mobile screen on your desktop.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Control your mobile by using desktop keyboard and mouse.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Copy/Cut/Paste text between mobile and desktop.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Capture mobile screen.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Drag and drop files to your mobile.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Support Mobile Explorer (File Browse)&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: &amp;quot;Lucida Grande&amp;quot;, &amp;quot;Geneva&amp;quot;, &amp;quot;Verdana&amp;quot;, &amp;quot;Arial&amp;quot;, sans-serif;"&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-2213069752683174376?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/2213069752683174376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/09/view-your-mobile-screen-on-your-desktop.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/2213069752683174376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/2213069752683174376'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/09/view-your-mobile-screen-on-your-desktop.html' title='View your mobile screen on your desktop'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-5382245622815286389</id><published>2010-09-09T18:41:00.007+05:30</published><updated>2011-10-20T16:09:56.838+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Csv'/><category scheme='http://www.blogger.com/atom/ns#' term='COALESCE'/><title type='text'>Generating Comma Seperated List Using SELECT Clause From Table Column</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Following script will Generate comma separate values or comma separate list from tables.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Method 1):&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;DECLARE&lt;/span&gt; @CSV &lt;span class="Apple-style-span" style="color: blue;"&gt;VARCHAR&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: magenta;"&gt;MAX&lt;/span&gt;)&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt; @CSV= &lt;span class="Apple-style-span" style="color: blue;"&gt;COALESCE(&lt;/span&gt;@CSV+ ',', '') + &amp;lt; Column Name &amp;gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM&lt;/span&gt; &amp;lt;TableName &amp;gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;WHERE&lt;/span&gt; &amp;lt;Condition &amp;gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT &lt;/span&gt;@CSV&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Method 2) :&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;DECLARE &lt;/span&gt;@Result &lt;span class="Apple-style-span" style="color: blue;"&gt;AS VARCHAR&lt;/span&gt;(2000)&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SET &lt;/span&gt;@Result = ''&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT &lt;/span&gt;@Result = &amp;lt; Column Name &amp;gt;+', '+ @Result&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM &lt;/span&gt;&amp;lt;TableName &amp;gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;WHERE &lt;/span&gt;&amp;lt;Condition &amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SET &lt;/span&gt;@Result=&lt;span class="Apple-style-span" style="color: magenta;"&gt;SUBSTRING&lt;/span&gt;(@Result,0,&lt;span class="Apple-style-span" style="color: magenta;"&gt;LEN&lt;/span&gt;(@Result))&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt; @Result&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Example:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;Below query gives "CourseName" as a table&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT &lt;/span&gt;CourseName&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM&lt;/span&gt; Courses&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Output:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;CourseName&lt;br /&gt;------------&lt;br /&gt;ASP.NET&lt;br /&gt;SQL Server 2005&lt;br /&gt;Java&lt;br /&gt;MVC&lt;br /&gt;&lt;br /&gt;If you give the following query, it will returns the data as a comma seperated values&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;DECLARE &lt;/span&gt;@CSV &lt;span class="Apple-style-span" style="color: blue;"&gt;VARCHAR&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: magenta;"&gt;MAX&lt;/span&gt;)&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT &lt;/span&gt;@CSV= &lt;span class="Apple-style-span" style="color: blue;"&gt;COALESCE(&lt;/span&gt;@CSV+ ',', '') + CourseName&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;FROM &lt;/span&gt;Courses&lt;br /&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT &lt;/span&gt;@CSV&lt;br /&gt;&lt;br /&gt;Output:&lt;br /&gt;ASP.NET,SQL Server 2005,Java,MVC&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the above methods First method is the efficient one. Because&lt;br /&gt;&lt;br /&gt;COALESCE function deals with the null values.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;COALESCE() :&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;According to MSDN, coalesce returns the first non-null expression among its arguments.&lt;br /&gt;COALESCE() accepts a series of values and a value to use in the event that all items in the list are null; then, it returns the first not-null value&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-5382245622815286389?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/5382245622815286389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/09/generating-comma-seperated-list-using.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/5382245622815286389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/5382245622815286389'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/09/generating-comma-seperated-list-using.html' title='Generating Comma Seperated List Using SELECT Clause From Table Column'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-750695327462133854</id><published>2010-09-08T19:53:00.002+05:30</published><updated>2011-10-26T09:26:43.523+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mobile'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net CE 3.5'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows CE'/><title type='text'>Fixing Error Messages Problem in windows CE</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;With .Net Compact Framework 3.5 the resources that display error messages are not loaded onto device by default. So our application always shows the following message, instead of original message&lt;br /&gt;&lt;br /&gt;"An error message is available for this exception but cannot be displayed because these messages are optional and are not currently installed on this device. Please install 'NETCFv35.Messages.EN.wm.cab' for Windows Mobile 5.0 and above or &amp;nbsp;'NETCFv35.Messages.EN.cab' for other platforms. Restart the application to see the message."&lt;br /&gt;&lt;br /&gt;This&amp;nbsp;'NETCFv35.Messages.EN.wm.cab' can be found in the directory&lt;br /&gt;&lt;br /&gt;C:\Program Files\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE\DiagnosticsNETCFv35.Messages.EN.wm.cab (English messages)&lt;br /&gt;&lt;br /&gt;If after doing this also you get the following message when an exception message is displayed, do the following&lt;br /&gt;&lt;br /&gt;1) Open the 'NETCFv35.Messages.EN.wm.cab' file available in the above location with winzip or any cab extractor&lt;br /&gt;2) Extract the file named "SYCCFA~1.001" and rename it "System.SR.dll"&lt;br /&gt;3)&amp;nbsp;Add System.SR.dll as a reference to your project&lt;br /&gt;4) Deploy the application.&lt;br /&gt;&lt;br /&gt;Then the application shows the correct exception messages.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-750695327462133854?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/750695327462133854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/09/fixing-error-messages-problem-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/750695327462133854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/750695327462133854'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/09/fixing-error-messages-problem-in.html' title='Fixing Error Messages Problem in windows CE'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-2493522244388797208</id><published>2010-09-04T17:14:00.002+05:30</published><updated>2011-10-20T16:11:17.711+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='MS DOS'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><category scheme='http://www.blogger.com/atom/ns#' term='Lock folder'/><title type='text'>Lock your folder with a batch file</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;You can make the folder lock software by your own.&lt;br /&gt;Just Copy and paste the following code into a notepad and save it as a batch file (i.e. with ".bat" extension).&lt;br /&gt;Then close the notepad and click the batch file. It creates a folder with name "Locker" in the same location.&lt;br /&gt;Now paste all the folders and files which you want to hide into the "Locker" folder. Double click the batch file and enter 'y' &amp;nbsp;or 'Y' to lock the folder. It will locks your folder.&lt;br /&gt;If you want to unlock your folder, double click the batch file again and you would be prompted for password.&lt;br /&gt;Enter the password and access your files&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK&lt;br /&gt;if NOT EXIST Locker goto MDLOCKER&lt;br /&gt;:CONFIRM&lt;br /&gt;echo Are you sure u want to Lock the folder(Y/N)&lt;br /&gt;set/p "cho=&amp;gt;"&lt;br /&gt;if %cho%==Y goto LOCK&lt;br /&gt;if %cho%==y goto LOCK&lt;br /&gt;if %cho%==n goto END&lt;br /&gt;if %cho%==N goto END&lt;br /&gt;cls&lt;br /&gt;echo Invalid choice.&lt;br /&gt;goto CONFIRM&lt;br /&gt;:LOCK&lt;br /&gt;ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"&lt;br /&gt;attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"&lt;br /&gt;cls&lt;br /&gt;echo Folder locked&lt;br /&gt;goto End&lt;br /&gt;:UNLOCK&lt;br /&gt;echo Enter password to Unlock folder&lt;br /&gt;set/p "pass=&amp;gt;"&lt;br /&gt;if NOT %pass%=="your password" goto FAIL&lt;br /&gt;attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"&lt;br /&gt;ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker&lt;br /&gt;cls&lt;br /&gt;echo Folder Unlocked successfully&lt;br /&gt;goto End&lt;br /&gt;:FAIL&lt;br /&gt;cls&lt;br /&gt;echo Invalid password&lt;br /&gt;goto UNLOCK&lt;br /&gt;:MDLOCKER&lt;br /&gt;md Locker&lt;br /&gt;cls&lt;br /&gt;echo Locker created successfully&lt;br /&gt;goto End&lt;br /&gt;:End&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In the above code change the "your password" with your password before saving as batch file(remove the double quotes also) It is the password to unlock your folder&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-2493522244388797208?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/2493522244388797208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/09/lock-your-folder-without-any-software.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/2493522244388797208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/2493522244388797208'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/09/lock-your-folder-without-any-software.html' title='Lock your folder with a batch file'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-2947480166856744097</id><published>2010-09-04T15:25:00.002+05:30</published><updated>2011-10-20T16:11:17.712+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Firefox with in firefox'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips and Tricks'/><title type='text'>Run Firefox inside Firefox</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;How about opening a Firefox in Firefox window?&lt;br /&gt;Not bad .. and it's very easy too....&lt;br /&gt;Just type the following URL in the Firefox address bar&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: Georgia, 'Times New Roman', Times, serif;"&gt;&lt;b&gt;chrome://browser/content/browser.xul&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Following is the screen shot of that one&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/_g9mSDvkLUPk/TIIXFBZeXcI/AAAAAAAAAKQ/2tb7wOEoysI/s1600/Untitled.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="300" src="http://3.bp.blogspot.com/_g9mSDvkLUPk/TIIXFBZeXcI/AAAAAAAAAKQ/2tb7wOEoysI/s400/Untitled.jpg" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Enjoy the trick....&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-2947480166856744097?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/2947480166856744097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/09/run-firefox-inside-firefox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/2947480166856744097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/2947480166856744097'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/09/run-firefox-inside-firefox.html' title='Run Firefox inside Firefox'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_g9mSDvkLUPk/TIIXFBZeXcI/AAAAAAAAAKQ/2tb7wOEoysI/s72-c/Untitled.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-8565685385898641353</id><published>2010-08-03T17:16:00.001+05:30</published><updated>2011-10-26T09:27:32.274+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Service'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#.NET'/><title type='text'>Controlling a Windows Service from .NET Application</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;You can use the ServiceController component to connect to and control the behavior of existing services. When you create an instance of the ServiceController class, you set its properties so that it interacts with a specific Windows service.&lt;br /&gt;&lt;br /&gt;This class is available in namespace&lt;br /&gt;"&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;System.ServiceProcess&lt;/span&gt;"&lt;br /&gt;&lt;div&gt;First we need to create object for this class like below&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;ServiceController oService = new ServiceController("DataImportService");&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Here "DataImportService" is the Service Name in my system.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Below are the methods to start,stop,Pause and Continue the services.&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;oService.Start();&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;oService.Stop();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;oService.Pause();&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;oService.Continue();&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;At any time the service is in one of the below state&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;ContinuePending&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;Paused&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;PausePending&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;Running&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;StartPending&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;Start&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;Stopped&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;StopPending&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;We can know the status of the service also using status property &lt;/span&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt; &lt;/span&gt;&lt;/span&gt;if (service.Status == ServiceControllerStatus.Stopped)&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;service.Start();&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;above statement checks whether the service is stopped and if yes, it starts the service.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;if (service.Status == ServiceControllerStatus.Running)&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;service.Stop();&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;Some times ASP.net Worker process doesnot have permission to stop or pause the services.For that we can check using &lt;/span&gt;CanStop,CanPauseAndContinue,CanShutdown&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt; &lt;/span&gt;&lt;/span&gt;If(oService.CanStop)&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt; &amp;nbsp;oService.Stop();&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;We have another 2 useful overloaded methods&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;"&lt;/span&gt;WaitForStatus(ServiceControllerStatus desiredStatus)&lt;span class="Apple-style-span" style="color: black;"&gt;" and&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;"&lt;/span&gt;WaitForStatus(ServiceControllerStatus desiredStatus,TimeSpan timeout)&lt;span class="Apple-style-span" style="color: black;"&gt;" .&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;First method Infinitely waits for the service to reach the specified status, and&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;the second method Waits for the service to reach the specified status or for the specified time-out to expire.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;oService.WaitForStatus(ServiceControllerStatus.Stopped)&lt;span class="Apple-style-span" style="color: black;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;It waits until the Service is Stopped.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;oService.WaitForStatus(ServiceControllerStatus.Stopped, TimeSpan.FromMinutes(5));&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;It waits until the Service is Stopped for fiveminutes. After five minutes it gives an Timeout Exception.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: #b45f06;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-8565685385898641353?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/8565685385898641353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/08/controlling-windows-service-from-net.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/8565685385898641353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/8565685385898641353'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/08/controlling-windows-service-from-net.html' title='Controlling a Windows Service from .NET Application'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-8694238943360734205</id><published>2010-08-02T17:16:00.004+05:30</published><updated>2011-10-20T16:15:02.902+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sql Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Date Time formats'/><category scheme='http://www.blogger.com/atom/ns#' term='Conversion formats'/><title type='text'>SQL Server Date Time Conversion Formats</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Below are the basic formats for converting the date time values into varchar in SQL Server 2005&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt; convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 100)&lt;span class="Apple-style-span" style="color: #38761d;"&gt; -- mon dd yyyy hh:mmAM (or PM)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- Aug 2 2010 11:01AM          &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 101) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mm/dd/yyyy - 08/02/2010                  &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 102) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yyyy.mm.dd - 2010.08.02           &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 103) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- dd/mm/yyyy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 104) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- dd.mm.yyyy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 105) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- dd-mm-yyyy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 106)&lt;span class="Apple-style-span" style="color: #38761d;"&gt; -- dd mon yyyy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 107)&lt;span class="Apple-style-span" style="color: #38761d;"&gt; -- mon dd, yyyy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 108) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- hh:mm:ss&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 109) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mon dd yyyy hh:mm:ss:mmmAM (or PM)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- Aug 2 2010 11:02:44:013AM   &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 110) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mm-dd-yyyy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 111) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yyyy/mm/dd&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 112) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yyyymmdd (&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;&amp;nbsp;ISO date format ,&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;international standard - works with any language setting)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 113)&lt;span class="Apple-style-span" style="color: #38761d;"&gt; -- dd mon yyyy hh:mm:ss:mmm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- 02 Aug 2010 11:02:07:577     &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 114) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- hh:mm:ss:mmm(24h)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 120)&lt;span class="Apple-style-span" style="color: #38761d;"&gt; -- yyyy-mm-dd hh:mm:ss(24h)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 121)&lt;span class="Apple-style-span" style="color: #38761d;"&gt; -- yyyy-mm-dd hh:mm:ss.mmm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 126) &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yyyy-mm-ddThh:mm:ss.mmm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- 2010-08-02T10:52:47.513&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;DateTime conversions -&amp;nbsp;&amp;nbsp;Without century (YY)&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 0)&lt;span class="Apple-style-span" style="color: #38761d;"&gt;   -- mon dd yyyy hh:mmAM (or PM)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 1)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mm/dd/yy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 2)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yy.mm.dd          &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 3)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- dd/mm/yy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 4)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- dd.mm.yy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 5)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- dd-mm-yy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 6)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- dd mon yy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&amp;nbsp;&lt;/span&gt;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 7)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mon dd, yy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 8)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- hh:mm:ss&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 9)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mon dd yyyy hh:mm:ss:mmmAM (or PM)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 10)  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mm-dd-yy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 11)  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yy/mm/dd&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 12)&lt;span class="Apple-style-span" style="color: #38761d;"&gt;  -- yymmdd&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 13)  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- dd mon yyyy hh:mm:ss:mmm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 14)  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- hh:mm:ss:mmm(24h)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 20)&lt;span class="Apple-style-span" style="color: #38761d;"&gt;  -- yyyy-mm-dd hh:mm:ss(24h)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 21)  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yyyy-mm-dd hh:mm:ss.mmm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 22)  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mm/dd/yy hh:mm:ss AM (or PM)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 23)  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yyyy-mm-dd&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 24)&lt;span class="Apple-style-span" style="color: #38761d;"&gt;  -- hh:mm:ss&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 25)  &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yyyy-mm-dd hh:mm:ss.mmm &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;Different date styles with SQL string functions&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;replace(convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 111), '/', ' ') &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- yyyy mm dd&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;(7), getdate(), 126)&lt;span class="Apple-style-span" style="color: #38761d;"&gt;                 -- yyyy-mm&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;right(convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 106), 8)          &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mon yyyy&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;SELECT&lt;/span&gt;&amp;nbsp;substring(convert(&lt;span class="Apple-style-span" style="color: blue;"&gt;varchar&lt;/span&gt;, getdate(), 120),6, 11)   &lt;span class="Apple-style-span" style="color: #38761d;"&gt;-- mm-dd hh:mm&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-8694238943360734205?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/8694238943360734205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/08/sql-server-date-time-conversion-formats.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/8694238943360734205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/8694238943360734205'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/08/sql-server-date-time-conversion-formats.html' title='SQL Server Date Time Conversion Formats'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-2489715795736666279.post-8387505842787786594</id><published>2010-07-28T16:05:00.003+05:30</published><updated>2011-10-26T09:25:45.021+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#.NET'/><title type='text'>Select Distinct Rows from a DataTable</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;&lt;span class="Apple-style-span" style="color: #333333; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 16px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="border-bottom-style: none; border-bottom-width: 0px; border-color: initial; border-color: initial; border-left-style: none; border-left-width: 0px; border-right-style: none; border-right-width: 0px; border-style: initial; border-top-style: none; border-top-width: 0px; border-width: initial; font-family: inherit; font-style: inherit; font-weight: inherit; list-style-type: none; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 1em; outline-color: initial; outline-style: initial; outline-width: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none;"&gt;&lt;span class="Apple-style-span" style="color: black; font-family: Arial;"&gt;&lt;span class="Apple-style-span" style="line-height: normal;"&gt;In&lt;/span&gt;&lt;/span&gt; ADO.NET 2.0 there is a feature that allows you to create a new table containing the distinct entries from an existing table like below.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-bottom-color: rgb(56, 118, 29); border-bottom-width: 1px; border-left-color: rgb(56, 118, 29); border-left-width: 1px; border-right-color: rgb(56, 118, 29); border-right-width: 1px; border-top-color: rgb(56, 118, 29); border-top-width: 1px; color: #38761d;"&gt;DataTable distinctTable = originalTable.DefaultView.ToTable( /*distinct*/ true)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It gets all the distinct rows from the original Table.&lt;br /&gt;If you want only a single column we can use...&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #38761d;"&gt;DataTable distinctTable = originalTable.DefaultView.ToTable( /*distinct*/ true, /*Column Name*/ "Col1")&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2489715795736666279-8387505842787786594?l=gopisportal.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://gopisportal.blogspot.com/feeds/8387505842787786594/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://gopisportal.blogspot.com/2010/07/select-distinct-rows-from-datatable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/8387505842787786594'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2489715795736666279/posts/default/8387505842787786594'/><link rel='alternate' type='text/html' href='http://gopisportal.blogspot.com/2010/07/select-distinct-rows-from-datatable.html' title='Select Distinct Rows from a DataTable'/><author><name>Gopikrishna</name><uri>http://www.blogger.com/profile/17293164999306327694</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
