<?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:blogger='http://schemas.google.com/blogger/2008' 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-5109242678088115909</id><updated>2024-11-01T15:18:28.261+05:30</updated><category term="ASP.NET"/><category term="SQL Server"/><category term="C#"/><category term="HTML"/><category term="WPF"/><category term="CSS"/><category term="Javascript"/><category term="LINQ"/><title type='text'>Harinadh</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-3743954024693525224</id><published>2014-10-17T16:03:00.001+05:30</published><updated>2014-10-17T16:13:43.309+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Permanent Login Session in ASP.NET using Forms Authentication</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The configuration of form authentication resides in &lt;em&gt;web.config&lt;/em&gt; file which has the following configuration-file fragment with the assigned values.&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;authentication&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;mode&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Forms&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;
      &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;forms&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;loginUrl&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;LogIn.aspx&quot;&lt;/span&gt; 
             &lt;span style=&quot;color: red;&quot;&gt;protection&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;All&quot;&lt;/span&gt;
             &lt;span style=&quot;color: red;&quot;&gt;timeout&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;1&quot;&lt;/span&gt;
             &lt;span style=&quot;color: red;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;.USERLOGINAUTH&quot;&lt;/span&gt;
             &lt;span style=&quot;color: red;&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;/&quot;&lt;/span&gt;
             &lt;span style=&quot;color: red;&quot;&gt;requireSSL&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;false&quot;&lt;/span&gt;
             &lt;span style=&quot;color: red;&quot;&gt;slidingExpiration&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;true&quot;&lt;/span&gt;
             &lt;span style=&quot;color: red;&quot;&gt;defaultUrl&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Default.aspx&quot;&lt;/span&gt;
             &lt;span style=&quot;color: red;&quot;&gt;cookieless&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;UseDeviceProfile&quot;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: maroon;&quot;&gt;authentication&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
Properties described below&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 100%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;144&quot;&gt;Property&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;228&quot;&gt;Description&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;126&quot;&gt;Default Value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;143&quot;&gt;loginUrl&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;225&quot;&gt;&lt;br /&gt;
&lt;code&gt;P&lt;/code&gt;oints to your application&#39;s custom logon page.&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;130&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;143&quot;&gt;&lt;br /&gt;
&lt;code&gt;protection&lt;/code&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;223&quot;&gt;&lt;br /&gt;
Gets or sets the encryption type used to encrypt the cookie. &lt;br /&gt;
This causes the cookie to be encrypted using the algorithm specified on the &lt;code&gt;machineKey&lt;/code&gt; element, and to be signed using the hashing algorithm that is also specified on the &lt;code&gt;machineKey&lt;/code&gt; element.&lt;br /&gt;
&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;132&quot;&gt;All&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;142&quot;&gt;timeout&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;222&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New;&quot;&gt;U&lt;/span&gt;sed to specify a limited lifetime for the forms authentication session. The default value is 30 minutes. If a persistent forms authentication cookie is issued, the &lt;code&gt;timeout&lt;/code&gt; attribute is also used to set the lifetime of the persistent cookie.&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;134&quot;&gt;30&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;142&quot;&gt;name&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;221&quot;&gt;&lt;br /&gt;
Gets or sets the cookie name.&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;135&quot;&gt;.ASPXAUTH&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;142&quot;&gt;path&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;221&quot;&gt;&lt;br /&gt;
Gets or sets the cookie path.&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;136&quot;&gt;/&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;142&quot;&gt;requireSSL&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;220&quot;&gt;&lt;br /&gt;
Gets or sets a value indicating whether a Secure Sockets Layer (SSL) connection is required when transmitting authentication information. &lt;br /&gt;
If you are concerned about session hijacking, you should consider setting &lt;code&gt;requireSSL&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt;.&lt;br /&gt;
&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;136&quot;&gt;false&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;142&quot;&gt;&lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.configuration.formsauthenticationconfiguration.slidingexpiration(v=vs.110).aspx&quot;&gt;slidingExpiration&lt;/a&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;220&quot;&gt;&lt;br /&gt;
When the SlidingExpiration is set to true, the time interval during which the authentication cookie is valid is reset to the expiration &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.web.configuration.formsauthenticationconfiguration.timeout(v=vs.110).aspx&quot;&gt;Timeout&lt;/a&gt; property value. This happens if the user browses after half of the timeout has expired. &lt;br /&gt;
For example, if you set an expiration of 20 minutes by using sliding expiration, a user can visit the site at 2:00 PM and receive a cookie that is set to expire at 2:20 PM. The expiration is only updated if the user visits the site after 2:10 PM. If the user visits the site at 2:09 PM, the cookie is not updated because half of the expiration time has not passed. If the user then waits 12 minutes, visiting the site at 2:21 PM, the cookie will be expired.&lt;br /&gt;
&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;136&quot;&gt;true&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;142&quot;&gt;defaultUrl&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;220&quot;&gt;&lt;br /&gt;
The URL to which to redirect the request after authentication.&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;136&quot;&gt;&lt;br /&gt;
default.aspx&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;142&quot;&gt;cookieless&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;229&quot;&gt;&lt;br /&gt;
The Cookieless property defines whether forms-based authentication should use a cookie to exchange user information.&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;140&quot;&gt;&lt;pre&gt;UseDeviceProfile&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;h4&gt;
Create authentication ticket while login&lt;/h4&gt;
Below code is used in login page or control on the click of login button. This function validates the login of the user and then add a permanent form authentication ticket to the browser.&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;background-color: #f4f4f4; border-bottom: silver 1px solid; border-left: silver 1px solid; border-right: silver 1px solid; border-top: silver 1px solid; cursor: text; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 20px 0px 10px; max-height: 200px; overflow: auto; padding-bottom: 4px; padding-left: 4px; padding-right: 4px; padding-top: 4px; text-align: left; width: 97.5%;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;FormsAuthenticationTicket ticket = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; FormsAuthenticationTicket(
      1,
      Username,
      DateTime.Now,
      DateTime.MaxValue,
      &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;,
      Password,
      FormsAuthentication.FormsCookiePath);

&lt;span style=&quot;color: green;&quot;&gt;// Encrypt the cookie using the machine key for secure transport&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; encUserAuthTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie cookie = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; HttpCookie(FormsAuthentication.FormsCookieName, encUserAuthTicket); &lt;span style=&quot;color: green;&quot;&gt;// Hashed ticket&lt;/span&gt;

&lt;span style=&quot;color: green;&quot;&gt;// Set the cookie&#39;s expiration time to the tickets expiration time&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;if&lt;/span&gt; (ticket.IsPersistent) cookie.Expires = ticket.Expiration;

&lt;span style=&quot;color: green;&quot;&gt;// Add the cookie to the list for outgoing response&lt;/span&gt;
context.Response.Cookies.Add(cookie);

FormsAuthentication.SetAuthCookie(Username, &lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h5&gt;
FormsAuthentication.SetAuthCookie&lt;/h5&gt;
This method creates an authentication ticket for the supplied user name and adds it to the cookies collection of the response, or to the URL if you are using cookieless authentication. The first overload of this function has two parameters: &lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;&lt;code&gt;userName&lt;/code&gt;: The name of the authenticated user &lt;/li&gt;
&lt;li&gt;&lt;code&gt;createPersisntentCookie&lt;/code&gt;: &lt;code&gt;True &lt;/code&gt;to create a persistent cookie (one that is saved across browser sessions); otherwise, &lt;code&gt;false&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;This method add a cookie or persistent cookie to the browser with an expire time set in &quot;&lt;code&gt;timeOut&lt;/code&gt;&quot; parameter with the name and path set in &quot;&lt;code&gt;name&lt;/code&gt;&quot; and &quot;&lt;code&gt;path&lt;/code&gt;&quot; parameter. The user will be automatically logged out once the cookie is expired. So the user login session depends on the expire of forms authentication ticket saved in browser cookie. Here, I will create a permanent user login session using this technique. &lt;br /&gt;
&lt;br /&gt;
Happy coding…&lt;br /&gt;
  &lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/3743954024693525224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2014/10/permanent-login-session-in-aspnet-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/3743954024693525224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/3743954024693525224'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2014/10/permanent-login-session-in-aspnet-using.html' title='Permanent Login Session in ASP.NET using Forms Authentication'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-1416177477043267653</id><published>2014-02-27T16:13:00.001+05:30</published><updated>2014-02-27T16:14:15.629+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="WPF"/><title type='text'>Setting the Initial Focus for User Control’s Textbox in WPF ModalDialog</title><content type='html'>&lt;p&gt;Below is the code for setting focus to user control’s textbox which is loaded as modaldialog in WPF.&lt;/p&gt; &lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: &#39;Courier New&#39;, courier, monospace; border-right: silver 1px solid; width: 97.5%; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; background-color: #f4f4f4&quot;&gt;&lt;pre id=&quot;codeSnippet&quot; style=&quot;border-top-style: none; overflow: visible; font-size: 8pt; font-family: &#39;Courier New&#39;, courier, monospace; width: 100%; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; border-left-style: none; line-height: 12pt; padding-right: 0px; background-color: #f4f4f4&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; MyUserControl()&lt;br&gt;{&lt;br&gt;    InitializeComponent();&lt;br&gt;    FocusManager.SetFocusedElement(&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;, txtQuantity);&lt;br&gt;&lt;br&gt;}&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/1416177477043267653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2014/02/setting-initial-focus-for-user-control.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/1416177477043267653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/1416177477043267653'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2014/02/setting-initial-focus-for-user-control.html' title='Setting the Initial Focus for User Control’s Textbox in WPF ModalDialog'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-4238410601557980525</id><published>2012-11-21T11:12:00.001+05:30</published><updated>2012-11-21T11:12:17.485+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Sort table rows randomly in SQL Server</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;SELECT&lt;/span&gt; * &lt;span style=&quot;color: #0000ff&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;table&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;BY&lt;/span&gt; NEWID()&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;In the above example NEWID() creates a unique value of type uniqueidentifier for each row and sort the rows accordingly.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Below is the example for retrieving a single random record from a table&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;TOP&lt;/span&gt; 1 * &lt;span style=&quot;color: #0000ff&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;table&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;BY&lt;/span&gt; NEWID()&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;Happy coding…  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/4238410601557980525/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/11/sort-table-rows-randomly-in-sql-server.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/4238410601557980525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/4238410601557980525'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/11/sort-table-rows-randomly-in-sql-server.html' title='Sort table rows randomly in SQL Server'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-8431442175063428546</id><published>2012-11-01T17:32:00.001+05:30</published><updated>2012-11-01T17:32:39.739+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="LINQ"/><title type='text'>Retrieving top 10 records from Data Table using LINQ in ASP.NET</title><content type='html'>&lt;p&gt;The below code will retrieve top 10 records from the data table.&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;DataTable1.AsEnumerable().Take(10);&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Note:&lt;em&gt; Add using System.Linq on the top.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;If intellesense is not showing up, add reference to System.Core&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;We can copy these records to another data table as below&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;DataTable1.AsEnumerable().Take(10).CopyToDataTable();&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;Happy coding…  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/8431442175063428546/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/11/retrieving-top-10-records-from-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/8431442175063428546'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/8431442175063428546'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/11/retrieving-top-10-records-from-data.html' title='Retrieving top 10 records from Data Table using LINQ in ASP.NET'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-9573156577036615</id><published>2012-11-01T17:15:00.001+05:30</published><updated>2012-11-01T17:33:58.204+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>How to truncate text while data binding</title><content type='html'>&lt;p&gt;How to truncate text in a label control to allow maximum number of characters. I would like to avoid using code behind because the label is in a repeater.&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;background-color: #ffff00&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; # Eval(&lt;span style=&quot;color: #006080&quot;&gt;&quot;EventDate&quot;&lt;/span&gt;).ToString().Substring(startIndex, Length of string)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;span style=&quot;background-color: #ffff00&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/9573156577036615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/11/how-to-truncate-text-while-data-binding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/9573156577036615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/9573156577036615'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/11/how-to-truncate-text-while-data-binding.html' title='How to truncate text while data binding'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-7328100472316559676</id><published>2012-09-18T16:41:00.001+05:30</published><updated>2012-09-18T16:41:50.032+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>How to find last day of month in C#</title><content type='html'>&lt;h3&gt;&amp;nbsp;&lt;/h3&gt; &lt;p&gt;Below is the code for retrieving last day (max days) in a month.&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;System.DateTime.DaysInMonth(&lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; year, &lt;span style=&quot;color: #0000ff&quot;&gt;int&lt;/span&gt; month)&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/7328100472316559676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/09/how-to-find-last-day-of-month-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/7328100472316559676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/7328100472316559676'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/09/how-to-find-last-day-of-month-in-c.html' title='How to find last day of month in C#'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-299192956535689604</id><published>2012-09-12T19:49:00.001+05:30</published><updated>2012-09-18T18:25:11.287+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="CSS"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><title type='text'>Text rotation using HTML/CSS</title><content type='html'>&lt;p&gt;Have you ever needed to create a &lt;b&gt;vertical text&lt;/b&gt;? Something like: &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;div style=&quot;filter: flipv fliph; writing-mode: tb-rl; margin-left: 30px; width: 60px; font-family: calibri; white-space: nowrap; height: 135px; color: green; font-size: 20pt; font-weight: bold; -webkit-transform: rotate(270deg); -moz-transform: rotate(270deg); -o-transform: rotate(270deg)&quot;&gt;Sample Text&lt;/div&gt; &lt;p&gt;It is very simple and straight forward. We can use &lt;b&gt;CSS &lt;/b&gt;to achieve that, the only issue we have to consider is compatibility.  &lt;p&gt;&lt;b&gt;Code&lt;/b&gt;  &lt;p&gt;Let&#39;s start creating a simple div with a class (&quot;VerticalText&quot; for our example):&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;VerticalText&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;Sample Text&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;As said, the problem is giving full compatibility with the rendered text. To do so, we need to treat Webkit, Mozilla, Opera and IE in different way. This time, Internet Explorer is the easiest: we will use the writing-mode and flip properties. For all other browsers, we are going to use transform with rotate.&lt;br&gt;Here is our final style: &lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;p&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;style&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;text/css&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;.VerticalText {&lt;br&gt;    color: green;&lt;br&gt;    writing-mode:tb-rl;&lt;br&gt;     filter: flipv fliph;&lt;br&gt;    -webkit-transform:rotate(270deg);&lt;br&gt;    -moz-transform:rotate(270deg);&lt;br&gt;    -o-transform: rotate(270deg);&lt;br&gt;    white-space:nowrap;&lt;br&gt;    width:60px; font-family: calibri;&lt;br&gt;    font-size:20pt;&lt;br&gt;    font-weight:bold;&lt;br&gt;}&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;For Internet Explorer we change the writing mode to top to bottom, right to left, then we flip it vertically and horizontally.&lt;br&gt;For Webkit, Mozilla and Opera, we use transform and rotate (270deg).&lt;br&gt;The result will work in Opera 10.5+, IE6+, FF and Webkit based browsers.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/299192956535689604/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/09/text-rotation-using-htmlcss.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/299192956535689604'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/299192956535689604'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/09/text-rotation-using-htmlcss.html' title='Text rotation using HTML/CSS'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-5109247564179743203</id><published>2012-08-27T17:02:00.001+05:30</published><updated>2012-08-27T17:02:16.504+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>How to generate row number in sql server</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;SELECT&lt;/span&gt;&lt;br&gt;    ROW_NUMBER() &lt;span style=&quot;color: #0000ff&quot;&gt;OVER&lt;/span&gt;( &lt;span style=&quot;color: #0000ff&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;BY&lt;/span&gt; ColumnName),   &lt;br&gt;    ColumnName1, ColumnName2,... &lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;FROM&lt;/span&gt; TableName&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;Happy coding…  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/5109247564179743203/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/08/how-to-generate-row-number-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/5109247564179743203'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/5109247564179743203'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/08/how-to-generate-row-number-in-sql-server.html' title='How to generate row number in sql server'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-6964882486341124040</id><published>2012-08-27T16:52:00.001+05:30</published><updated>2012-08-27T16:52:20.383+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>How to add auto generated serial number column to Grid View?</title><content type='html'>&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&amp;lt;asp:GridView  runat=&lt;span style=&quot;color: #006080&quot;&gt;&quot;server&quot;&lt;/span&gt; id=&lt;span style=&quot;color: #006080&quot;&gt;&quot;GridView1&quot;&lt;/span&gt;&amp;gt;&lt;br&gt;    &amp;lt;Columns&amp;gt;&lt;br&gt;        &amp;lt;asp:TemplateField ItemStyle-Height=&lt;span style=&quot;color: #006080&quot;&gt;&quot;20&quot;&lt;/span&gt;&amp;gt;&lt;br&gt;            &amp;lt;ItemTemplate&amp;gt;&lt;br&gt;                    &amp;lt;%#Container.DataItemIndex+1 %&amp;gt;&lt;br&gt;            &amp;lt;/ItemTemplate&amp;gt;&lt;br&gt;        &amp;lt;/asp:TemplateField&amp;gt;&lt;br&gt;    &amp;lt;/Columns&amp;gt;&lt;br&gt;&amp;lt;/asp:GridView&amp;gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;Happy coding…  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/6964882486341124040/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/08/how-to-add-auto-generated-serial-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/6964882486341124040'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/6964882486341124040'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/08/how-to-add-auto-generated-serial-number.html' title='How to add auto generated serial number column to Grid View?'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-2895261433500586384</id><published>2012-08-21T17:33:00.001+05:30</published><updated>2012-08-21T17:33:36.096+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>How to replace a string in a SQL Server Table Column</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Updating SQL Server table column using REPLACE function&lt;/p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 89.35%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 74px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;UPDATE&lt;/span&gt; TABLENAME&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;SET&lt;/span&gt; COLUMNNAME = REPLACE(COLUMNNAME, &lt;span style=&quot;color: #006080&quot;&gt;&#39;Old String&#39;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&#39;New String&#39;&lt;/span&gt;)&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;WHERE&lt;/span&gt; CONDITION&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/2895261433500586384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/08/how-to-replace-string-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/2895261433500586384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/2895261433500586384'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/08/how-to-replace-string-in-sql-server.html' title='How to replace a string in a SQL Server Table Column'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-8007851774684010823</id><published>2012-07-18T16:21:00.001+05:30</published><updated>2012-07-18T16:56:08.135+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><title type='text'>Upload Profile Picture Using AsyncFileUpload Control in ASP.NET</title><content type='html'>&lt;p&gt;This article shows how to preview the image before uploading the image to the server so that it can be saved into the database later. User will always like to see the image which has to be uploaded. This has been done using AsyncFileUpload(Ajax Control Toolkit) and HTTPHandler.&lt;/p&gt; &lt;p&gt;Here I am not interested to display the file upload control below the image control. Just these should be an image where user has to click on that to change/upload profile picture.&lt;/p&gt; &lt;p&gt;Below is the css for the desired UI&lt;/p&gt; &lt;p&gt;1. Write the below style under &amp;lt;head&amp;gt; section of asp.net page&lt;/p&gt; &lt;p&gt; &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;style&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;text/css&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    .FileUploadClass&lt;br&gt;    {&lt;br&gt;        font-size: 5px;&lt;br&gt;        z-index: 500;&lt;br&gt;        position: relative;&lt;br&gt;        z-index: 10;&lt;br&gt;    }&lt;br&gt;    .FileUploadClass input[type=file]&lt;br&gt;    {&lt;br&gt;        background: transparent;&lt;br&gt;        border: Dashed 2px #000000;&lt;br&gt;        opacity: 0;&lt;br&gt;        filter: alpha(opacity = 0);&lt;br&gt;        width: 150px;&lt;br&gt;        height: 150px;&lt;br&gt;    }&lt;br&gt;    .FakeFileUpload&lt;br&gt;    {&lt;br&gt;        position: relative;&lt;br&gt;        border: Solid 1px #000000;&lt;br&gt;        width: 150px;&lt;br&gt;        height: 150px;&lt;br&gt;        z-index: 1;&lt;br&gt;    }&lt;br&gt;    .FakeFileUploadDiv&lt;br&gt;    {&lt;br&gt;        width: 150px;&lt;br&gt;        height: 150px;&lt;br&gt;        position: absolute;&lt;br&gt;        opacity: 1.0;&lt;br&gt;        -ms-filter: &quot;progid:DXImageTransform.Microsoft.Alpha(Opacity=100)&quot;;&lt;br&gt;        filter: alpha(opacity=100);&lt;br&gt;        z-index: 5;&lt;br&gt;    }&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;style&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. Below code should be placed under &amp;lt;body&amp;gt; section of asp.net page&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:UpdatePanel&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;UpdatePanel1&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;UpdateMode&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Always&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ContentTemplate&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;FakeFileUpload&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;class&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;FakeFileUploadDiv&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:Image&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;imgPhoto&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ImageUrl&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;~/images/Employee.png&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;alt&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;Employee Photo&quot;&lt;/span&gt;&lt;br&gt;                    &lt;span style=&quot;color: #ff0000&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;150px&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;150px&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ajaxToolkit:AsyncFileUpload&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;AsyncFileUpload1&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ThrobberID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;loader&quot;&lt;/span&gt;&lt;br&gt;                &lt;span style=&quot;color: #ff0000&quot;&gt;CssClass&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;FileUploadClass&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;OnClientUploadComplete&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;OnClientAsyncFileUploadComplete&quot;&lt;/span&gt;&lt;br&gt;                &lt;span style=&quot;color: #ff0000&quot;&gt;OnUploadedComplete&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;AsyncFileUpload1_UploadedComplete&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;150&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:Image&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ID&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;loader&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;ImageUrl&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&quot;~/images/loading.gif&quot;&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;ContentTemplate&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;asp:UpdatePanel&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;p&gt;3. So this is UI part. Next we need to write some server side code for “&lt;strong&gt;OnUploadComplete&lt;/strong&gt;” event of &lt;strong&gt;AsyncFileUpload&lt;/strong&gt; control to save the uploaded file in a “temp” folder.&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum1&quot;&gt;   1:&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;protected&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; AsyncFileUpload1_UploadedComplete(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, AjaxControlToolkit.AsyncFileUploadEventArgs e)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum2&quot;&gt;   2:&lt;/span&gt;     {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum3&quot;&gt;   3:&lt;/span&gt;         &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (AsyncFileUpload1.PostedFile != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum4&quot;&gt;   4:&lt;/span&gt;         {&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum5&quot;&gt;   5:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; uploadedFileName = Path.GetFileName(AsyncFileUpload1.FileName);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum6&quot;&gt;   6:&lt;/span&gt;             AsyncFileUpload1.SaveAs(Server.MapPath(&lt;span style=&quot;color: #006080&quot;&gt;&quot;~/temp/&quot;&lt;/span&gt;) + uploadedFileName);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum7&quot;&gt;   7:&lt;/span&gt;             imgPhoto.ImageUrl = &lt;span style=&quot;color: #006080&quot;&gt;&quot;~/temp/&quot;&lt;/span&gt; + uploadedFileName;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum8&quot;&gt;   8:&lt;/span&gt;             HttpPostedFile file = AsyncFileUpload1.PostedFile;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum9&quot;&gt;   9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum10&quot;&gt;  10:&lt;/span&gt;             &lt;span style=&quot;color: #0000ff&quot;&gt;byte&lt;/span&gt;[] data = ReadFile(file);&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum11&quot;&gt;  11:&lt;/span&gt;             &lt;span style=&quot;color: #008000&quot;&gt;//Store the image in the session.&lt;/span&gt;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum12&quot;&gt;  12:&lt;/span&gt;             Session[&lt;span style=&quot;color: #006080&quot;&gt;&quot;STORED_IMAGE&quot;&lt;/span&gt;] = data;&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum13&quot;&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #606060&quot; id=&quot;lnum14&quot;&gt;  14:&lt;/span&gt;     }&lt;/pre&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;In the above code, the user selected file will be stored in server temp folder and also image control’s “IamgeUrl” is also set to the uploaded file.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;font size=&quot;3&quot;&gt;Problem&lt;/font&gt;&lt;/strong&gt;&lt;em&gt;&lt;font size=&quot;3&quot;&gt;: &lt;/font&gt;&lt;strong&gt;Here there is no problem with file uploading, but the uploaded image will not be displayed to the user even image control’s path is changed. This is because of AJAX AsyncFileUpload control.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;font size=&quot;3&quot;&gt;Solution: &lt;/font&gt;&lt;/strong&gt;&lt;strong&gt;Image Preview before uploading&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;After the file is uploaded instead of saving it in the location in the server instead HttpHandler can be used which can write the uploaded image directly into the response. so no storage and less headaches.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;So we don’t need lines from 5 to 8 in the above snippet. We need to have only lines 10 to 12.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;i&lt;/strong&gt;. Store the uploaded image into Session in binary format.&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (asyncFileUpload.PostedFile != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br&gt;{&lt;br&gt;    HttpPostedFile file = asyncFileUpload.PostedFile;&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;byte&lt;/span&gt;[] data = ReadFile(file);&lt;br&gt;    &lt;span style=&quot;color: #008000&quot;&gt;//Store the image in the session.&lt;/span&gt;&lt;br&gt;    Session[&lt;span style=&quot;color: #006080&quot;&gt;&quot;STORED_IMAGE&quot;&lt;/span&gt;] = data;&lt;br&gt;}&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Below is the code for converting image into binary format.&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;byte&lt;/span&gt;[] ReadFile(HttpPostedFile file)&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;byte&lt;/span&gt;[] data = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; Byte[file.ContentLength];&lt;br&gt;    file.InputStream.Read(data, 0, file.ContentLength);&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; data;&lt;br&gt;}&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;ii&lt;/strong&gt;. After image is uploaded need to call an image handler to generate image preview. For this I am using client side event “&lt;span style=&quot;color: #ff0000&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;OnClientUploadComplete” of AsyncFileUpload control.&lt;/font&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;color: #ff0000&quot;&gt;&lt;/span&gt;Below is the javascript&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&amp;lt;script language=&lt;span style=&quot;color: #006080&quot;&gt;&quot;javascript&quot;&lt;/span&gt; type=&lt;span style=&quot;color: #006080&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&amp;gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;function&lt;/span&gt; getRandomNumber() {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; randomnumber = Math.random(10000);&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; randomnumber;&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;function&lt;/span&gt; OnClientAsyncFileUploadComplete(sender, args) {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; handlerPage = &lt;span style=&quot;color: #006080&quot;&gt;&#39;&amp;lt;%= Page.ResolveClientUrl(&quot;~/ImageHandler.ashx&quot;)%&amp;gt;&#39;&lt;/span&gt;;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; queryString = &lt;span style=&quot;color: #006080&quot;&gt;&#39;?randomno=&#39;&lt;/span&gt; + getRandomNumber();&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; src = handlerPage + queryString;&lt;br&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; clientId = &lt;span style=&quot;color: #006080&quot;&gt;&#39;&amp;lt;%=imgPhoto.ClientID %&amp;gt;&#39;&lt;/span&gt;;&lt;br&gt;        document.getElementById(clientId).setAttribute(&lt;span style=&quot;color: #006080&quot;&gt;&quot;src&quot;&lt;/span&gt;, src);&lt;br&gt;    }&lt;br&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Note: Use the randomnumber in the querystring of the handler otherwise, browser caches the first image and returns the same image again and again.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;iii&lt;/strong&gt;. Create the HttpHandler which is using (ImageHandler.ashx) in the above javascript&lt;/p&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; ImageRequestHandler : IHttpHandler, IRequiresSessionState&lt;br&gt;{&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ProcessRequest(HttpContext context)&lt;br&gt;    {&lt;br&gt;        context.Response.Clear();&lt;br&gt;&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (context.Request.QueryString.Count != 0)&lt;br&gt;        {&lt;br&gt;            &lt;span style=&quot;color: #008000&quot;&gt;//Get the stored image and write in the response.&lt;/span&gt;&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; storedImage = context.Session[&lt;span style=&quot;color: #006080&quot;&gt;&quot;STORED_IMAGE&quot;&lt;/span&gt;] &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;byte&lt;/span&gt;[];&lt;br&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (storedImage != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br&gt;            {&lt;br&gt;                Image image = GetImage(storedImage);&lt;br&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (image != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br&gt;                {&lt;br&gt;                    context.Response.ContentType = &lt;span style=&quot;color: #006080&quot;&gt;&quot;image/jpeg&quot;&lt;/span&gt;;&lt;br&gt;                    image.Save(context.Response.OutputStream, ImageFormat.Jpeg);&lt;br&gt;                }&lt;br&gt;            }&lt;br&gt;        }&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; Image GetImage(&lt;span style=&quot;color: #0000ff&quot;&gt;byte&lt;/span&gt;[] storedImage)&lt;br&gt;    {&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; stream = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; MemoryStream(storedImage);&lt;br&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; Image.FromStream(stream);&lt;br&gt;    }&lt;br&gt;&lt;br&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;bool&lt;/span&gt; IsReusable&lt;br&gt;    {&lt;br&gt;        get { &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;; }&lt;br&gt;    }&lt;br&gt;}&lt;/pre&gt;&lt;br&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Note: Use the IRequiresSessionState to access the session variables in the Handler.&lt;br /&gt;&lt;p&gt;In the above code image preview will be generated based on the binary data stored in Session variable (step 3).&lt;br /&gt;&lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/8007851774684010823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/07/profile-picture-using-asyncfileupload.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/8007851774684010823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/8007851774684010823'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/07/profile-picture-using-asyncfileupload.html' title='Upload Profile Picture Using AsyncFileUpload Control in ASP.NET'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-137155647949618377</id><published>2012-07-17T17:13:00.001+05:30</published><updated>2012-07-17T17:13:56.271+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Using REPLACE in an UPDATE statement</title><content type='html'>&lt;p&gt;The REPLACE function is easy to use and very handy with an UPDATE statment. &lt;p&gt;Replace searches for certain characters in a string and replaces them with other characters. &lt;p&gt;Syntax:&lt;pre&gt;&lt;code&gt;UPDATE &amp;lt;table name&amp;gt; SET &amp;lt;column name&amp;gt; = REPLACE(&amp;lt;COLUMN Name&amp;gt;, &#39;oldstring&#39;, &#39;newstring&#39;) &lt;/code&gt;&lt;code&gt;WHERE &amp;lt;Condition&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;Happy Coding…&lt;/code&gt;&lt;/pre&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/137155647949618377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/07/using-replace-in-update-statement.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/137155647949618377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/137155647949618377'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/07/using-replace-in-update-statement.html' title='Using REPLACE in an UPDATE statement'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-2878155044653496025</id><published>2012-07-13T20:26:00.001+05:30</published><updated>2012-07-13T20:31:02.706+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Sending Email from GoDaddy Windows Shared Hosting using asp.net 3.5</title><content type='html'>&lt;p&gt;&amp;nbsp; &lt;p&gt;The server &quot;relay-hosting.secureserver.net&quot; is used to send email from your hosted domain on GoDaddy.com servers. You must populate the SmtpMail object&#39;s SmtpServer property with this value. &lt;p&gt;&amp;nbsp; &lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;rem&quot;&gt;// import namespace&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Web.Mail;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SendEmail()&lt;/pre&gt;&lt;pre&gt;{&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;   &lt;span class=&quot;kwrd&quot;&gt;const&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; SERVER = &lt;span class=&quot;str&quot;&gt;&quot;relay-hosting.secureserver.net&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;   MailMessage oMail = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; System.Web.Mail.MailMessage();&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;   oMail.From = &lt;span class=&quot;str&quot;&gt;&quot;emailaddress@domainname&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;   oMail.To = &lt;span class=&quot;str&quot;&gt;&quot;emailaddress@domainname&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;   oMail.Subject = &lt;span class=&quot;str&quot;&gt;&quot;Test email subject&quot;&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;   oMail.BodyFormat = MailFormat.Html; &lt;span class=&quot;rem&quot;&gt;// enumeration&lt;/span&gt;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;   oMail.Priority = MailPriority.High; &lt;span class=&quot;rem&quot;&gt;// enumeration&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;   oMail.Body = &lt;span class=&quot;str&quot;&gt;&quot;Sent at: &quot;&lt;/span&gt; + DateTime.Now;&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;   SmtpMail.SmtpServer = SERVER;&lt;/pre&gt;&lt;pre&gt;   SmtpMail.Send(oMail);&lt;/pre&gt;&lt;pre class=&quot;alt&quot;&gt;   oMail = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;; &lt;span class=&quot;rem&quot;&gt;// free up resources&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;}&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Note:&lt;em&gt; GoDaddy servers will not send email containing a “From:” header entry of gmail, yahoo, hotmail, live, aim, aol or msn.&lt;/em&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;Happy Coding…&lt;/em&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/2878155044653496025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/07/sending-email-from-godaddy-windows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/2878155044653496025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/2878155044653496025'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/07/sending-email-from-godaddy-windows.html' title='Sending Email from GoDaddy Windows Shared Hosting using asp.net 3.5'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-1079713016552267986</id><published>2012-03-03T16:34:00.001+05:30</published><updated>2012-03-03T16:50:40.991+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Using Relative path for including script and css files in asp.net UserControl</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I have asp.net usercontrol that is including some js script and cs files like&lt;pre&gt;&lt;code&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;/UserControl/JScripts/JScripts.js&quot;/&amp;gt;&lt;br&gt;&amp;lt;link rel=&quot;Stylesheet&quot; href=&quot;/UserControl/css/style.css&quot; type=&quot;text/css&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;I am going to use this control in different pages which are in different directories.&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;In that case these styles/scripts not working in all pages because of relative path used in user control&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;For these kinds of elements, &lt;code&gt;&lt;strong&gt;Page.ResolveClientUrl()&lt;/strong&gt;&lt;/code&gt; is the perfect solution. &lt;br /&gt;&lt;p&gt;As this user control could be used from any web page within the web application, there will be path related issues with these &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; and &lt;code&gt;&amp;lt;link&amp;gt;&lt;/code&gt; elements also (If paths properties are set for one page appropriately, the same path will not work other pages in different directory ).&lt;br&gt;To solve this issue, the above elements should also be modified with the &lt;code&gt;ResolveClientUrl()&lt;/code&gt; as follows:&amp;nbsp; &lt;span style=&quot;background-color: #f4f4f4&quot; class=&quot;kwrd&quot;&gt;&lt;br /&gt;&lt;div id=&quot;codeSnippetWrapper&quot; class=&quot;csharpcode-wrapper&quot;&gt;&lt;pre id=&quot;codeSnippet&quot; class=&quot;csharpcode&quot;&gt;&lt;pre&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&#39;&amp;lt;%=ResolveClientUrl(&quot;~/UserControl/JScripts/JScripts.js&quot;)%&amp;gt;&#39; /&amp;gt;&lt;br /&gt;&amp;lt;link rel=&quot;Stylesheet&quot; href=&#39;&amp;lt;%=ResolveClientUrl(&quot;~/UserControl/css/style.css&quot;)%&amp;gt;&#39; type=&quot;text/css&quot; /&amp;gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Happy Coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/1079713016552267986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2012/03/using-relative-path-for-including.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/1079713016552267986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/1079713016552267986'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2012/03/using-relative-path-for-including.html' title='Using Relative path for including script and css files in asp.net UserControl'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-3924024547898633642</id><published>2011-12-21T11:42:00.000+05:30</published><updated>2011-12-21T12:50:52.786+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Prevent postback events on page refresh</title><content type='html'>&lt;p&gt;A common concern of ASP.NET developers is, &quot;How do I prevent previously submitted form data from being reinserted into the database when the user presses the browser&#39;s Refresh button?&quot;  &lt;p&gt;Different solutions are available for this problem.  &lt;ol&gt; &lt;li&gt;&lt;strong&gt;Reload the page after successful postback &lt;/strong&gt; &lt;p&gt;A simple solution is to Reload the same page using Response.Redirect after successful transaction.&lt;/p&gt; &lt;p&gt; &lt;div id=&quot;codeSnippetWrapper&quot; class=&quot;csharpcode-wrapper&quot;&gt; &lt;div id=&quot;codeSnippet&quot; class=&quot;csharpcode&quot;&gt; &lt;div id=&quot;codeSnippetWrapper&quot;&gt; &lt;div style=&quot;background-color: #f4f4f4&quot; id=&quot;codeSnippetWrapper&quot; class=&quot;csharpcode-wrapper&quot;&gt; &lt;div class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;Response.Redirect(Request.Url.ToString(), &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;);&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;!--CRLF--&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;A disadvantage of this approach is that page ViewSate will not be retained.&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Using OnClientClick event (javascript)&lt;/strong&gt; &lt;br /&gt;&lt;p&gt;Create a javascript function which validates the fields to be submitted. If any validation failed it has to return false otherwise it has to return true. &lt;br /&gt;&lt;p&gt;To avoid the post back handle the OnClientClick event call the javascript function which retuns true on successful validation otherwise false. If OnClientClick gets true from the script function then it would raise the OnClick event, otherwise it would not. &lt;br /&gt;&lt;div style=&quot;background-color: #f4f4f4&quot; class=&quot;csharpcode&quot;&gt;&lt;pre class=&quot;alt&quot;&gt;&amp;lt;asp:Button ID=&lt;span class=&quot;str&quot;&gt;&quot;btnValidate&quot;&lt;/span&gt; runat=&lt;span class=&quot;str&quot;&gt;&quot;server&quot;&lt;/span&gt; Text=&lt;span class=&quot;str&quot;&gt;&quot;Click Here!!&quot;&lt;/span&gt; OnClientClick=&lt;span class=&quot;str&quot;&gt;&quot; return ValidateEmail()&quot;&lt;/span&gt; OnClick =&lt;span class=&quot;str&quot;&gt;&quot;btnValidate_Click&quot;&lt;/span&gt;/&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Below is the sample javascript:&lt;pre style=&quot;background-color: #f4f4f4&quot; class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; ValidateEmail()&lt;br /&gt;    {   &lt;br /&gt;         &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; x = document.getElementById(&lt;span class=&quot;str&quot;&gt;&#39;txtemail&#39;&lt;/span&gt;);&lt;br /&gt;        &lt;br /&gt;         &lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; val = x.value;&lt;br /&gt;         &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(val == &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;)&lt;br /&gt;         {&lt;br /&gt;           alert(&lt;span class=&quot;str&quot;&gt;&quot;Please enter your email id&quot;&lt;/span&gt;);&lt;br /&gt;           x.focus();&lt;br /&gt;           &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;br /&gt;         }&lt;br /&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;    }&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;&lt;i&gt;The fields should be cleared on successful completion of postback.&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;&lt;li&gt;&lt;strong&gt;Server-side code using Session and ViewState variables&lt;/strong&gt; &lt;br /&gt;&lt;p&gt;A simple way to implement refresh trapping is by the use of a date/time stamp held in a ViewState variable and a date/time stamp held in the user&#39;s Session. When the page is first loaded, a Session variable is populated with the current date/time. On the page&#39;s PreRender event, a ViewState variable is set to the value of the Session variable. These two values are compared to each other immediately before the database INSERT command is run. &lt;br /&gt;&lt;p&gt;If they are equal, then the command is permitted to execute and the Session variable is updated with the current date/time, otherwise the command is bypassed. Should the user refresh the page, the ViewState variable will be repopulated from the post header, so then the ViewState and Session variables will no longer hold the same values, and the INSERT command will not run. Note that ViewState needs to be enabled on the page for this to work; if ViewState is not enabled then a hidden form field may be used instead. &lt;pre style=&quot;background-color: #f4f4f4&quot; class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (!Page.IsPostBack) {&lt;br /&gt;        Session[&lt;span class=&quot;str&quot;&gt;&quot;update&quot;&lt;/span&gt;] = Server.UrlEncode(System.DateTime.Now.ToString());&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Page_PreRender(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    ViewState[&lt;span class=&quot;str&quot;&gt;&quot;update&quot;&lt;/span&gt;] = Session[&lt;span class=&quot;str&quot;&gt;&quot;update&quot;&lt;/span&gt;];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Button1_Click(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (Session[&lt;span class=&quot;str&quot;&gt;&quot;update&quot;&lt;/span&gt;].ToString() == ViewState[&lt;span class=&quot;str&quot;&gt;&quot;update&quot;&lt;/span&gt;].ToString()) {&lt;br /&gt;        &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (AddEmployee(firstName.Text, lastName.Text) == 0) {&lt;br /&gt;            Message.Text = &lt;span class=&quot;str&quot;&gt;&quot;Success&quot;&lt;/span&gt;;&lt;br /&gt;            Session[&lt;span class=&quot;str&quot;&gt;&quot;update&quot;&lt;/span&gt;] = Server.UrlEncode(System.DateTime.Now.ToString());&lt;br /&gt;        } &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; {&lt;br /&gt;            Message.Text = &lt;span class=&quot;str&quot;&gt;&quot;Failure&quot;&lt;/span&gt;;&lt;br /&gt;        }&lt;br /&gt;    } &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; {&lt;br /&gt;        Message.Text = &lt;span class=&quot;str&quot;&gt;&quot;Failure - Session&quot;&lt;/span&gt;;&lt;br /&gt;    }&lt;br /&gt;    firstName.Text = &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;br /&gt;    lastName.Text = &lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/3924024547898633642/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/12/prevent-postback-events-on-page-refresh.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/3924024547898633642'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/3924024547898633642'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/12/prevent-postback-events-on-page-refresh.html' title='Prevent postback events on page refresh'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-1246718931408114354</id><published>2011-10-22T22:02:00.001+05:30</published><updated>2011-10-22T23:12:35.121+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><category scheme="http://www.blogger.com/atom/ns#" term="HTML"/><category scheme="http://www.blogger.com/atom/ns#" term="Javascript"/><title type='text'>Child window (popup) close event in parent window</title><content type='html'>&lt;p&gt;This is the most useful and most wanted code for raising window close event of child window from parent window.&lt;/p&gt; &lt;div style=&quot;background-color: #f4f4f4&quot; class=&quot;csharpcode&quot;&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; childWindow = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; timer;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;var&lt;/span&gt; flag = 1;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   &lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; openChildWindow() {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   &lt;/span&gt;    childWindow = window.open(&lt;span class=&quot;str&quot;&gt;&#39;child.htm&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;My popup&#39;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&#39;width=400,height=250&#39;&lt;/span&gt;);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   &lt;/span&gt;    childWindow.focus();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;   &lt;/span&gt;}&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; checkChildWindowStatus() {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;     &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (childWindow.closed) {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;         &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt; (flag == 1)&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;              window.location.reload();&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;              flag = 0;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;         }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;         &lt;span class=&quot;kwrd&quot;&gt;else&lt;/span&gt; {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;              timer = 0;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;              flag = 1;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;         }&lt;/pre&gt;&lt;pre&gt;   }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt; window.onload = &lt;span class=&quot;kwrd&quot;&gt;function&lt;/span&gt; () {&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt;     timer = setInterval(&lt;span class=&quot;str&quot;&gt;&#39;checkChildWindowStatus()&#39;&lt;/span&gt;, 1000);&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;lnum&quot;&gt;  &lt;/span&gt; }&lt;/pre&gt;&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;In the above code childWindow is the variable which reference to the popup window. Using this window status can be identified.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;checkChildWindowStatus() is the function where the popup window status is checking and based on this some action (page refresh) can be performed in parent window. This function is getting called for frequent interval of time using serInterval() method.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/1246718931408114354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/10/child-window-popup-close-event-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/1246718931408114354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/1246718931408114354'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/10/child-window-popup-close-event-in.html' title='Child window (popup) close event in parent window'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-4564264180377173704</id><published>2011-10-22T21:51:00.001+05:30</published><updated>2011-10-22T21:51:28.184+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>InitCap in asp.net</title><content type='html'>&lt;p&gt;Below is the line of code for rendering text in InitCap format.&lt;/p&gt; &lt;p&gt;System.Globalization.CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(txtName.ToString().ToLower())&lt;/p&gt; &lt;p&gt;Here the source string should be in lower case.&lt;/p&gt; &lt;p&gt;Happy coding…&lt;/p&gt; &lt;style type=&quot;text/css&quot;&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt;	font-size: small;&lt;br /&gt;	color: black;&lt;br /&gt;	font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt;	background-color: #ffffff;&lt;br /&gt;	/*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt;	background-color: #f4f4f4;&lt;br /&gt;	width: 100%;&lt;br /&gt;	margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }&lt;br /&gt;&lt;/style&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/4564264180377173704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/10/initcap-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/4564264180377173704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/4564264180377173704'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/10/initcap-in-aspnet.html' title='InitCap in asp.net'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-5980800416899129023</id><published>2011-10-08T11:09:00.001+05:30</published><updated>2011-10-08T11:15:50.424+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Access web control on Nested master page from content page</title><content type='html'>&lt;p&gt;For example I have a DropDownList control in the inner master page. This control can be accessed from the content page in 2 ways.&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Using the findcontrol method to access the DropDownList, you need to use the DropDownList&#39;s ClientID.  &lt;p&gt;For example :&lt;/p&gt; &lt;p&gt;DropDownList list = (DropDownList)this.Master.FindControl(&quot;ctl00$ctl00$ContentPlaceHolder1$DropDownList1&quot;);&lt;/p&gt; &lt;li&gt;Expose the DropDownList control in the inner master page&#39;s code bhind, then the control can accessed directly.&lt;/li&gt;&lt;/ol&gt; &lt;ul&gt; &lt;ul&gt; &lt;li&gt;Expose the DropDownList control:&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;blockquote&gt; &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public DropDownList list&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return this.DropDownList1;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }  &lt;p&gt;&amp;nbsp; &lt;ul&gt; &lt;li&gt;Add the masterType for the content page to strong type the master page:  &lt;p&gt;&amp;lt;%@ MasterType VirtualPath=&quot;~/Masterpage/NestMasterPage/MasterPage2.master&quot; %&amp;gt;  &lt;p&gt;&amp;nbsp; &lt;/p&gt; &lt;li&gt;Access the DropDownList in the content page&#39;s codebehind:  &lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DropDownList list = this.Master.list; &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt; &lt;p&gt;Happy Coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/5980800416899129023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/10/access-web-control-on-nested-master.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/5980800416899129023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/5980800416899129023'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/10/access-web-control-on-nested-master.html' title='Access web control on Nested master page from content page'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-512309223868059310</id><published>2011-08-17T14:48:00.000+05:30</published><updated>2011-08-17T14:50:47.979+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>IDENT_CURRENT–Retrieve last inserted identity of record</title><content type='html'>&lt;p&gt;&lt;strong&gt;SELECT IDENT_CURRENT(‘&amp;lt;tablename&amp;gt;’)&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;br&gt;It returns the last IDENTITY value produced in a table, regardless of the connection that created the value, and regardless of the scope of the statement that produced the value.&lt;br&gt;IDENT_CURRENT is not limited by scope and session; it is limited to a specified table. IDENT_CURRENT returns the identity value generated for a specific table in any session and any scope.&lt;/p&gt; &lt;p&gt;Happy Coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/512309223868059310/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/08/identcurrentretrieve-last-inserted.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/512309223868059310'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/512309223868059310'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/08/identcurrentretrieve-last-inserted.html' title='IDENT_CURRENT–Retrieve last inserted identity of record'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-3523554286704012784</id><published>2011-06-07T14:31:00.001+05:30</published><updated>2011-06-07T14:31:01.298+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Simulating ListView’s ItemCommand Event</title><content type='html'>&lt;p&gt;Data controls in asp.net like GridView, DataList, Repeater, ListView,… are having an event called ItemCommand.&lt;/p&gt; &lt;p&gt;This event will raise whenever any button, linkbutton,… are clicked.&lt;/p&gt; &lt;p&gt;But my requirement is to call the ItemCommand event whenever the ListView.Databind() is done.&lt;/p&gt; &lt;p&gt;Below is the procedure I followed for that.&lt;/p&gt; &lt;p style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;System.Web.UI.WebControls.&lt;/font&gt;&lt;/font&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;span&gt;&lt;font color=&quot;#2b91af&quot;&gt;LinkButton&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; lnkbtn = (System.Web.UI.WebControls.&lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#2b91af&quot;&gt;LinkButton&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt;)lvMyAlbums.Items[0].FindControl(&lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#a31515&quot;&gt;&quot;lnkAlbum&quot;&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&lt;span&gt;&lt;font color=&quot;#2b91af&quot;&gt;ListViewCommandEventArgs&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; ev = &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#2b91af&quot;&gt;ListViewCommandEventArgs&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt;(lvMyAlbums.Items[0], lnkbtn, &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#2b91af&quot;&gt;CommandEventArgs&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt;(lnkbtn.CommandName, lnkbtn.CommandArgument));&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span&gt;&lt;font style=&quot;font-size: 9.5pt&quot; color=&quot;#008000&quot;&gt;// Call ItemCommand handler&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;line-height: normal; margin: 0in 0in 0pt; mso-layout-grid-align: none&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: &quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;span style=&quot;mso-spacerun: yes&quot;&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;font style=&quot;font-size: 9.5pt&quot;&gt;lvMyAlbums_OnItemCommand(lvMyAlbums, ev);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style=&quot;line-height: 13pt; margin: 0in 0in 10pt&quot; class=&quot;MsoNormal&quot;&gt;&lt;font face=&quot;Calibri&quot;&gt;&lt;font style=&quot;font-size: 11pt&quot; color=&quot;#000000&quot;&gt;&amp;nbsp;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;line-height: 13pt; margin: 0in 0in 10pt&quot; class=&quot;MsoNormal&quot;&gt;&lt;font color=&quot;#000000&quot; face=&quot;Calibri&quot;&gt;Happy coding…&lt;/font&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/3523554286704012784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/06/simulating-listviews-itemcommand-event.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/3523554286704012784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/3523554286704012784'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/06/simulating-listviews-itemcommand-event.html' title='Simulating ListView’s ItemCommand Event'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-2367680811539105488</id><published>2011-06-01T16:55:00.000+05:30</published><updated>2011-06-01T16:55:42.829+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SQL Server"/><title type='text'>Convert DateTime to Indian Standard Time format in SQL Server</title><content type='html'>&lt;p&gt;DATEADD() function would be used to convert UTC to IST in SQL Server.&lt;/p&gt; &lt;p&gt;Below is the sample code for that.&lt;/p&gt; &lt;p&gt;&lt;font color=&quot;#0000ff&quot;&gt;DECLARE &lt;/font&gt;@UTCTime&lt;font color=&quot;#0000ff&quot;&gt; As DATETIME&lt;/font&gt;;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;SET&lt;/font&gt; @UTCTime = &lt;font color=&quot;#9b00d3&quot;&gt;GETUTCDATE()&lt;/font&gt;;&lt;br&gt;&lt;font color=&quot;#0000ff&quot;&gt;SELECT &lt;/font&gt;&lt;font color=&quot;#9b00d3&quot;&gt;DATEADD&lt;/font&gt;(&lt;strong&gt;&lt;font size=&quot;2&quot;&gt;MI&lt;/font&gt;&lt;/strong&gt;, 330, @UTCTime) &lt;font color=&quot;#0000ff&quot;&gt;AS&lt;/font&gt; IST&lt;br&gt;&lt;/p&gt; &lt;p&gt;Happy Coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/2367680811539105488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/06/convert-datetime-to-indian-standard.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/2367680811539105488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/2367680811539105488'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/06/convert-datetime-to-indian-standard.html' title='Convert DateTime to Indian Standard Time format in SQL Server'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-5792985400082728030</id><published>2011-05-26T13:37:00.001+05:30</published><updated>2011-05-26T13:39:14.094+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>URL shortener in .net using bit.ly API</title><content type='html'>&lt;p&gt;It’s simple to generate shorten url based on long url using bit.ly API.&lt;/p&gt; &lt;p&gt;For this we need to have account with &lt;a href=&quot;http://bit.ly/a/sign_up&quot;&gt;http://bit.ly/a/sign_up&lt;/a&gt; which is free. After sign up completed, you will be provided with an API key &lt;a href=&quot;http://bit.ly/a/your_api_key&quot;&gt;http://bit.ly/a/your_api_key&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This API key can be used to access the API. Below is the code for API class in c#&lt;/p&gt;&lt;span style=&quot;line-height: normal; widows: 2; text-transform: none; text-indent: 0px; border-collapse: separate; font-family: ; white-space: normal; orphans: 2; letter-spacing: normal; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-family: &quot; class=&quot;Apple-style-span&quot;&gt; &lt;div&gt;&lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; overflow-x: visible; overflow-y: visible; border-right-style: none; background-color: rgb(244,244,244); margin: 0px; padding-left: 0px; width: 498px; padding-right: 0px; font-family: ; border-top-style: none; border-left-style: none; padding-top: 0px&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;&lt;font style=&quot;font-size: 8pt&quot;&gt;public&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style=&quot;font-size: 8pt&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;static class&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style=&quot;font-size: 8pt&quot;&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; BitlyApi&lt;br /&gt;{&lt;br /&gt;    &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;private&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;const&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; apiKey = &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#006080&quot;&gt;&quot;[add api key here]&quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;;&lt;br /&gt;    &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;private&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;const&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; login = &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#006080&quot;&gt;&quot;[add login name here]&quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;;&lt;br /&gt;&lt;br /&gt;    &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; BitlyResults ShortenUrl(&lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; longUrl)&lt;br /&gt;    {&lt;br /&gt;        var url =&lt;br /&gt;            &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt;.Format(&lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#006080&quot;&gt;&quot;http://api.bit.ly/shorten?format=xml&amp;amp;version=2.0.1&amp;amp;longUrl={0}&amp;amp;login={1}&amp;amp;apiKey={2}&quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;,&lt;br /&gt;                          HttpUtility.UrlEncode(longUrl), login, apiKey);&lt;br /&gt;        var resultXml = XDocument.Load(url);&lt;br /&gt;        var x = (from result &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;in&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; resultXml.Descendants(&lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#006080&quot;&gt;&quot;nodeKeyVal&quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;)&lt;br /&gt;                 select &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; BitlyResults&lt;br /&gt;                            {&lt;br /&gt;                                UserHash = result.Element(&lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#006080&quot;&gt;&quot;userHash&quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;).Value,&lt;br /&gt;                                ShortUrl = result.Element(&lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#006080&quot;&gt;&quot;shortUrl&quot;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;).Value&lt;br /&gt;                            }&lt;br /&gt;                );&lt;br /&gt;        &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; x.Single();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;class&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; BitlyResults&lt;br /&gt;{&lt;br /&gt;    &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face=&quot;Consolas&quot;&gt;&lt;font style=&quot;font-size: 8pt&quot;&gt;&lt;font color=&quot;#000000&quot;&gt; UserHash { get; set; }&lt;br /&gt;&lt;br /&gt;    &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; &lt;/font&gt;&lt;span&gt;&lt;font color=&quot;#0000ff&quot;&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color=&quot;#000000&quot;&gt; ShortUrl { get; set; }&lt;br /&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;br class=&quot;Apple-interchange-newline&quot;&gt;&lt;br /&gt;&lt;p&gt;Now, we can generate short url as below:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;string strShortUrl = BitlyApi.ShortenUrl(“&amp;lt;long url&amp;gt;&lt;a href=&quot;http://182.50.141.238:96/Uploads/&amp;quot;&quot;&gt;”&lt;/a&gt;).ShortUrl;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Happy Coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/5792985400082728030/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/05/url-shortener-in-net-using-bitly-api.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/5792985400082728030'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/5792985400082728030'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/05/url-shortener-in-net-using-bitly-api.html' title='URL shortener in .net using bit.ly API'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-3184172643604319952</id><published>2011-05-23T15:27:00.001+05:30</published><updated>2011-05-23T15:27:10.357+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="WPF"/><title type='text'>Customizing Date format in WPF</title><content type='html'>&lt;p&gt;The datepicker control in WPF allow short and Long formats. By default it will take system date format. &lt;p&gt;So we can change the date format as our application requires like dd/MM/yyyy or MM/dd/YYYY,… &lt;p&gt;Need to write some couple of lines under Application_Startup Event in App.XAML. &lt;p&gt;Below is the code for custom date format. &lt;p&gt;Thread.CurrentThread.CurrentCulture = (CultureInfo)Thread.CurrentThread.CurrentCulture.Clone(); &lt;p&gt;Thread.CurrentThread.CurrentCulture.DateTimeFormat.DateSeparator = &quot;/&quot;; &lt;p&gt;Thread.CurrentThread.CurrentCulture.DateTimeFormat.ShortDatePattern = &quot;dd/MM/yyyy&quot;; &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQTReU8eaPW598TiXVyZLhfKv1Rn6x44AMWeb197bVizdj8O4yfjk8OzfD2opXaAM2ORuIdMcPBAxHhvLOFptW8RaFGPUfnuzSKYHT3yT7TTOtNb_nvemt8EbK_9eJi28ZK742CLa7nSE/s1600-h/image%5B23%5D.png&quot;&gt;&lt;img title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW1qwT4pVHexhyphenhyphenZC4N-6beu9-4z24RrmtIQv035Qhce64QXjbpQhKlhs3eFspSBh2A04jcnXiT3BoTunz0tWSIV_epoLDSQhfm1ic9KwpE7lOYX-iP7_Ryl-JvDgjNMYtN8yN2LBX9jfs/?imgmax=800&quot; width=&quot;542&quot; height=&quot;94&quot;&gt;&lt;/a&gt; &lt;p&gt;This is event should be initiated from XAML code like below. &lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2b4xnpkb4qmDF1oTYMiHzATQoPNlATNaIoG8SZyMwbZxo7ktopjCXFfhzX7RdKfZuH5usTywwdPYIjHYQDJRS3x6GIc3oggQBEuYTAv0lpmzS88R1WVZxjKgjxyFBnbxTTcezLIEZvyY/s1600-h/image%5B20%5D.png&quot;&gt;&lt;img title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipcFITLOmgapVYjNZU1t5Klw0_YCsH3e-4C2-xtHyGYbe-nEZ-ZDe3pJS_7cuMXBZ3xC-Cv-UKjtm6Z9-i5SADswDcuN8KTU4QCZZQGyk03uZQONQ38V8usoEfbfCZGzHSV3u9jY4Cfwk/?imgmax=800&quot; width=&quot;538&quot; height=&quot;123&quot;&gt;&lt;/a&gt; &lt;p&gt;Happy Coding…   </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/3184172643604319952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2011/05/customizing-date-format-in-wpf_23.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/3184172643604319952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/3184172643604319952'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2011/05/customizing-date-format-in-wpf_23.html' title='Customizing Date format in WPF'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW1qwT4pVHexhyphenhyphenZC4N-6beu9-4z24RrmtIQv035Qhce64QXjbpQhKlhs3eFspSBh2A04jcnXiT3BoTunz0tWSIV_epoLDSQhfm1ic9KwpE7lOYX-iP7_Ryl-JvDgjNMYtN8yN2LBX9jfs/s72-c?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5109242678088115909.post-5947976494625907892</id><published>2010-08-12T17:26:00.004+05:30</published><updated>2011-06-07T14:59:26.842+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="ASP.NET"/><title type='text'>Membership and Roles in ASP.NET</title><content type='html'>&lt;div style=&quot;text-align: left&quot; dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;The aspnet_regsql.exe runs the ASP.NET SQL Server Setup Wizard which allows you to create or configure a SQL Server database to store information for membership, profiles, role management, personalization, and SQL Web event provider. Once created, you may use forms authentication and the login controls to access these tables.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;In the Microsoft.NET/Framework/... directory as shown below, find the aspnet_regsql.exe.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&lt;/div&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&lt;a style=&quot;margin-bottom: 1em; float: left; clear: left; margin-right: 1em&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF81DjD9HlaqkfX3F9u18HxTtyhWPmAcmJ0ucdtThIU3GmkiD4N-QLw4NCrCggrjcnItd7m9_eXUOwuX7f9qZuwwpib4RznH0TdnMFjB3IizuTE_6ieKJmsFEkB4LvOoOf9ZNkujTKMhQ/s1600/ASPNET_REGSQLRUN.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF81DjD9HlaqkfX3F9u18HxTtyhWPmAcmJ0ucdtThIU3GmkiD4N-QLw4NCrCggrjcnItd7m9_eXUOwuX7f9qZuwwpib4RznH0TdnMFjB3IizuTE_6ieKJmsFEkB4LvOoOf9ZNkujTKMhQ/s320/ASPNET_REGSQLRUN.png&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&lt;a style=&quot;margin-bottom: 1em; float: left; clear: left; margin-right: 1em&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifyGM__7xOAKlf55WNEcL_KUsYPzhvBX4dhmk3q0sembQT8AnrQqazjc1ZBjsGVKlkLGHQcJwSqYgJuwaoy9cj3fx5Nas98FYgCsnSpNZPmiZSeBMny7thQyITll5ASf5zAck56EqbYDU/s1600/ASPNET_REGSQLWizard1.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifyGM__7xOAKlf55WNEcL_KUsYPzhvBX4dhmk3q0sembQT8AnrQqazjc1ZBjsGVKlkLGHQcJwSqYgJuwaoy9cj3fx5Nas98FYgCsnSpNZPmiZSeBMny7thQyITll5ASf5zAck56EqbYDU/s320/ASPNET_REGSQLWizard1.png&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;Execute the aspnet_regsql.exe file to begin the ASP.NET SQL Server Setup Wizard to create the SQL Server database or add tables to an existing database:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;img src=&quot;http://www.shiningstar.net/ASPNet_Articles/images/aspNetSqlServerSetupWizard.jpg&quot; width=&quot;462&quot; height=&quot;356&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;Select to Configure SQL Server for application services:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;img src=&quot;http://www.shiningstar.net/ASPNet_Articles/images/configureSqlServerforApp.jpg&quot; width=&quot;477&quot; height=&quot;371&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;Select a Server name for Windows authentication and then select an existing database name or use the default. Choosing the default will name the database &quot;aspnetdb.&quot;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&lt;a style=&quot;margin-bottom: 1em; float: left; clear: left; margin-right: 1em&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjII2Ebf-MFao_PUxchZ-1EQ9J1x6f4IQEkwrcN7PfwcqWDaa9c8zJZKd1UWYk63Hra-kdD3_uCgTbe089f3rUAADcrcVo_owJoRVtzLf1YHiIpDi8c6WSAW6piL8MB9T7Hs0gbRPfmb-8/s1600/ASPNET_REGSQLWizard2.png&quot; imageanchor=&quot;1&quot;&gt; &lt;p&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjII2Ebf-MFao_PUxchZ-1EQ9J1x6f4IQEkwrcN7PfwcqWDaa9c8zJZKd1UWYk63Hra-kdD3_uCgTbe089f3rUAADcrcVo_owJoRVtzLf1YHiIpDi8c6WSAW6piL8MB9T7Hs0gbRPfmb-8/s640/ASPNET_REGSQLWizard2.png&quot; width=&quot;506&quot; height=&quot;389&quot;&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt; If you want to use an existing database, simply select the database.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;The wizard will now summarize, run and create the database.&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&lt;a style=&quot;margin-bottom: 1em; float: left; clear: left; margin-right: 1em&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfoD6T-jBGWka3oUExTAArVwFX73FvsV0gtYJxImH8IpIj4tZTra1LCtnZyY353yHblpZQUf6OU3bAxAfOIXGMlpn1h87rjvq00t-n72mfhyphenhyphenHnBOYA25swksJEs_ipQXRe57wuTfeMQ40/s1600/ASPNET_REGSQLWizard3.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfoD6T-jBGWka3oUExTAArVwFX73FvsV0gtYJxImH8IpIj4tZTra1LCtnZyY353yHblpZQUf6OU3bAxAfOIXGMlpn1h87rjvq00t-n72mfhyphenhyphenHnBOYA25swksJEs_ipQXRe57wuTfeMQ40/s640/ASPNET_REGSQLWizard3.png&quot; width=&quot;502&quot; height=&quot;388&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;After completion, you may use the Database Explorer to view your tables:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt; &lt;div style=&quot;text-align: center; clear: both&quot; class=&quot;separator&quot;&gt;&lt;a style=&quot;margin-bottom: 1em; float: left; clear: left; margin-right: 1em&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwt9pbm3z6lXmENzQ15k_3Vt9TO6Xjau-aAbKQGw0UVf4_fRyb5xvbNuV9apSXQ4K8pMBJdoHAym1C8tf49q8RfydKh8qWD53K_g4cDwWvPo4mKclRtRf5HUJ3lHs5oxqwd-4LzO50xDs/s1600/ASPNET_REGSQLWizard4.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwt9pbm3z6lXmENzQ15k_3Vt9TO6Xjau-aAbKQGw0UVf4_fRyb5xvbNuV9apSXQ4K8pMBJdoHAym1C8tf49q8RfydKh8qWD53K_g4cDwWvPo4mKclRtRf5HUJ3lHs5oxqwd-4LzO50xDs/s400/ASPNET_REGSQLWizard4.png&quot; width=&quot;166&quot; height=&quot;400&quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;When done creating the database, you would setup your web config file with the connection string to the aspnetdb.mdf. You would also make sure your authentication mode is set to forms: authentication mode=&quot;Forms&quot; (see below).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;br&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;img src=&quot;http://www.shiningstar.net/ASPNet_Articles/images/webCofig.jpg&quot; width=&quot;491&quot; height=&quot;157&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;Once you&#39;ve completed the connection string, you will w&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif; font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;ant to setup a user in your tables. To do this, you may use the ASP.NET Configuration under the Website menu item.&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif; font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;img src=&quot;http://www.shiningstar.net/ASPNet_Articles/images/aspNetConfig.jpg&quot; width=&quot;331&quot; height=&quot;237&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;img src=&quot;http://www.shiningstar.net/ASPNet_Articles/images/adminTool.jpg&quot; width=&quot;494&quot; height=&quot;318&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;You may use the Security tab to add and edit users.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;img src=&quot;http://www.shiningstar.net/ASPNet_Articles/images/security.jpg&quot; width=&quot;490&quot; height=&quot;454&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;Select the Create User link to create a user. Select the &quot;Administrators&quot; checkbox if you wish this to be an administrative account. Once your Admin account is created, others may use the CreateUserWizard in your application in order to create accounts.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt; &lt;div style=&quot;line-height: 18px&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;font-size: small&quot; class=&quot;Apple-style-span&quot;&gt;&lt;img src=&quot;http://www.shiningstar.net/ASPNet_Articles/images/createUser.jpg&quot; width=&quot;499&quot; height=&quot;305&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt; &lt;p&gt;Happy coding…&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://harynadh.blogspot.com/feeds/5947976494625907892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://harynadh.blogspot.com/2010/08/aspnet-membership-and-roles-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/5947976494625907892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5109242678088115909/posts/default/5947976494625907892'/><link rel='alternate' type='text/html' href='http://harynadh.blogspot.com/2010/08/aspnet-membership-and-roles-using.html' title='Membership and Roles in ASP.NET'/><author><name>Hari</name><uri>http://www.blogger.com/profile/02457753626420378985</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF81DjD9HlaqkfX3F9u18HxTtyhWPmAcmJ0ucdtThIU3GmkiD4N-QLw4NCrCggrjcnItd7m9_eXUOwuX7f9qZuwwpib4RznH0TdnMFjB3IizuTE_6ieKJmsFEkB4LvOoOf9ZNkujTKMhQ/s72-c/ASPNET_REGSQLRUN.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>