<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Happy Moments &#187; Programming</title>
	<atom:link href="http://blogs.myhappymoments.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.myhappymoments.com</link>
	<description>Just another weblog</description>
	<lastBuildDate>Thu, 15 Jul 2010 23:13:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Login failed &#8211; Error Number: 18456 &#8211; Severity: 14 &#8211; State: 1</title>
		<link>http://blogs.myhappymoments.com/2009/08/20/login-failed-error-number-18456-severity-14-state-1/</link>
		<comments>http://blogs.myhappymoments.com/2009/08/20/login-failed-error-number-18456-severity-14-state-1/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 10:54:00 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server Login]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=294</guid>
		<description><![CDATA[My Problem :

The SQL 2005 did install correctly on my 64bit Vista but I was not able to log on to the server and it gave the following error

Login failed for user 'PC-Name\UserName'. (.Net SqlClient Data Provider)

Error Number: 18456 - Severity: 14 - State: ]]></description>
			<content:encoded><![CDATA[<p>I came across this error when I tried to Install MS SQL 2005 on Vista.I have installed SQL plenty of times and never had problems before on my XP.</p>
<p>My Problem :</p>
<p>The SQL 2005 did install correctly on my 64bit Vista but I was not able to log on to the server and it gave the following error</p>
<p>Login failed for user &#8216;PC-Name\UserName&#8217;. (.Net SqlClient Data Provider)</p>
<p>Error Number: 18456 &#8211; Severity: 14 &#8211; State: 1<span id="more-294"></span></p>
<p>Solved :</p>
<p>Instead of running SQL Server Management studio as current user I run it as an Administrator.<br />
[ad#Link_5]<br />
Then in the Object Browser Select the server &gt; Security &gt; Logins &gt; New Login</p>
<p>Following window will be displayed</p>
<p><a href="http://blogs.myhappymoments.com/wp-content/uploads/2009/08/SQL2005LoginNew1.gif"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="SQL 2005 Login - New" src="http://blogs.myhappymoments.com/wp-content/uploads/2009/08/SQL2005LoginNew_thumb1.gif" border="0" alt="SQL 2005 Login - New" width="240" height="216" /></a></p>
<p>Click Search and the following window will be displayed</p>
<p><a href="http://blogs.myhappymoments.com/wp-content/uploads/2009/08/SQL2005SelectUser1.gif"><img style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" title="SQL 2005 Select User" src="http://blogs.myhappymoments.com/wp-content/uploads/2009/08/SQL2005SelectUser_thumb1.gif" border="0" alt="SQL 2005 Select User" width="240" height="216" /></a></p>
<p>In the text box enter your username and press check name and press ok.</p>
<p>And you are done.</p>
<p>Now you will not have to run your SQL Server Management studio as an Administrator.</p>
<p>Thank you</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2009/08/20/login-failed-error-number-18456-severity-14-state-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Read a Web Page and send it as an HTML Email</title>
		<link>http://blogs.myhappymoments.com/2009/04/22/read-a-web-page-and-send-it-as-an-html-email/</link>
		<comments>http://blogs.myhappymoments.com/2009/04/22/read-a-web-page-and-send-it-as-an-html-email/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 01:43:46 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Vb.net]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=276</guid>
		<description><![CDATA[Recently I was asked to write a code to send entire Aspx page as an HTML mail using VB.Net. Private Function ReadAspxPage(ByVal url As String) As String Dim htmlPage As String Dim objResponse As System.Net.WebResponse Dim objRequest As System.Net.WebRequest = System.Net.HttpWebRequest.Create(url) objResponse = objRequest.GetResponse() Dim readpage As New System.IO.StreamReader(objResponse.GetResponseStream()) htmlPage = readpage.ReadToEnd() readpage.Close() Return htmlPage.toString() ]]></description>
			<content:encoded><![CDATA[<p>Recently I was asked to write a code to send entire Aspx page as an HTML mail using VB.Net.<br />
<code>Private Function ReadAspxPage(ByVal url As String) As String<br />
Dim htmlPage As String<br />
Dim objResponse As System.Net.WebResponse<br />
Dim objRequest As System.Net.WebRequest = System.Net.HttpWebRequest.Create(url)<br />
objResponse = objRequest.GetResponse()<br />
Dim readpage As New System.IO.StreamReader(objResponse.GetResponseStream())</p>
<p>htmlPage = readpage.ReadToEnd()<br />
readpage.Close()</p>
<p>Return htmlPage.toString()<br />
End Function</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2009/04/22/read-a-web-page-and-send-it-as-an-html-email/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to read HTML file onServer in ASP.Net</title>
		<link>http://blogs.myhappymoments.com/2009/04/22/how-to-read-html-file-onserver-in-aspnet/</link>
		<comments>http://blogs.myhappymoments.com/2009/04/22/how-to-read-html-file-onserver-in-aspnet/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 01:31:57 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Read File]]></category>
		<category><![CDATA[Vb.net]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=273</guid>
		<description><![CDATA[Private Function GetEmailTemplate(ByVal templateName As String) As String Dim sr As IO.StreamReader = New IO.StreamReader(System.Web.HttpContext.Current.Server.MapPath(templateName)) Dim body As String = sr.ReadToEnd() sr.Close() sr.Dispose() Return body End Function]]></description>
			<content:encoded><![CDATA[<p><code>Private Function GetEmailTemplate(ByVal templateName As String) As String<br />
        Dim sr As IO.StreamReader = New IO.StreamReader(System.Web.HttpContext.Current.Server.MapPath(templateName))<br />
        Dim body As String = sr.ReadToEnd()<br />
        sr.Close()<br />
        sr.Dispose()<br />
        Return body<br />
    End Function</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2009/04/22/how-to-read-html-file-onserver-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Read all Mail Merge Field in an Collection.</title>
		<link>http://blogs.myhappymoments.com/2009/04/22/read-all-mail-merge-field-in-an-collection/</link>
		<comments>http://blogs.myhappymoments.com/2009/04/22/read-all-mail-merge-field-in-an-collection/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 00:37:49 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Mail Merge]]></category>
		<category><![CDATA[Vb.net]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=267</guid>
		<description><![CDATA[I was asked to read all Mail merge Files in an HTML Template and then perform a mail Merge. The MailMerge Fields were like ##[Field]##. So thought to use regex to find the fields. The biggest task for me was to write a regex for Matching ##[Merge Fields]##. This is the code that I ended ]]></description>
			<content:encoded><![CDATA[<p>I was asked to read all Mail merge Files in an HTML Template and then perform a mail Merge.<br />
The MailMerge Fields were like ##[Field]##.<br />
So thought to use regex to find the fields.</p>
<p>The biggest task for me was to write a regex for Matching ##[Merge Fields]##.<br />
<span id="more-267"></span><br />
This is the code that I ended with.</p>
<p bgcolor="red"><code>Private Function GetEmailMergeFields(ByVal body As String) As ListItemCollection<br />
Dim list As ListItemCollection = New ListItemCollection</p>
<p>Dim pattern As String = "##\[.*?\]##"<br />
Dim mymatches As System.Text.RegularExpressions.MatchCollection<br />
Dim myregex As New System.Text.RegularExpressions.Regex(pattern)</p>
<p>mymatches = myregex.Matches(body)<br />
For Each succ As System.Text.RegularExpressions.Match In mymatches<br />
list.Add(succ.Value)<br />
Next</p>
<p>Return list</p>
<p>End Function</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2009/04/22/read-all-mail-merge-field-in-an-collection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to set up Visual Studio Project to use NUnit-Gui Test Runner</title>
		<link>http://blogs.myhappymoments.com/2008/12/16/how-to-set-up-visual-studio-project-to-use-nunit-gui-test-runner/</link>
		<comments>http://blogs.myhappymoments.com/2008/12/16/how-to-set-up-visual-studio-project-to-use-nunit-gui-test-runner/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 22:57:18 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[NUnit]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=225</guid>
		<description><![CDATA[I am writing this post to help people like me who are new to nunit. Bascially it&#8217;s easy to setup but some time it can be really hard for some people. Here is how you accomplish the task : Once you have created the test project, Right click on the project name in the Solution ]]></description>
			<content:encoded><![CDATA[<p>I am writing this post to help people like me who are new to nunit. Bascially it&#8217;s easy to setup but some time it can be really hard for some people.<span id="more-225"></span></p>
<p>Here is how you accomplish the task :</p>
<ol>
<li>Once you have created the test project, Right click on the project name in the Solution Explorer and select &#8220;Set as Default&#8221; from the options.</li>
<li>Now Right Click on the project again and select the &#8220;Properties&#8221;. The window as shown below will be displayed. Select the &#8220;DEBUG Tab&#8221;, In the &#8220;Statr Acton&#8221; select Start External Radio button and browse to select nUnit Gui Runner (the .exe file).</li>
</ol>
<p>        <a href="http://blogs.myhappymoments.com/wp-content/uploads/2008/12/tut11.jpg"><img class="aligncenter size-full wp-image-230" title="tut11" src="http://blogs.myhappymoments.com/wp-content/uploads/2008/12/tut11.jpg" alt="" width="500" height="400" /></a> </p>
<p>Once you have followed the steps above you are ready to run your test. Just run your solution and the nUnit Gui Runner will apear.</p>
<p>When you start application for the first time, NUnit opens with no tests loaded.</p>
<p>Select &#8220;Open&#8221; from the file menu and select the test. Now click on the run button and you are done.</p>
<p> </p>
<p>Hope that helps,</p>
<p>Thank you</p>
<p>Now, you can run your test suite. By clicking the run icon in the Visual Studio toolbar the nUnit Gui Runner will popup but no tests will run automatically &#8211; however the Gui Runner will be populated with all the tests in your project. Now you just need to pick the test(s) you want to run and run them. If those tests (or the code they call) have any break points the Visual Studio window will reactivate when the breakpoint is reached and you can step through your code.</p>
<p>I hope this helps others embrace unit tests with .Net and Visual Studio</p>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2008/12/16/how-to-set-up-visual-studio-project-to-use-nunit-gui-test-runner/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Use Code Behind to display text on Binding</title>
		<link>http://blogs.myhappymoments.com/2008/12/01/how-to-use-code-behind-to-display-text-on-binding/</link>
		<comments>http://blogs.myhappymoments.com/2008/12/01/how-to-use-code-behind-to-display-text-on-binding/#comments</comments>
		<pubDate>Mon, 01 Dec 2008 08:46:38 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[Asp.net]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=207</guid>
		<description><![CDATA[I had to display Yes or No based on databind this is how I did it. &#60;asp:Label ID=&#8221;IsUserActiveCheckBox&#8221; Text=&#8217;&#60;%# if(Eval(&#8220;IsUserActive&#8221;),&#8221;Yes&#8221;,&#8221;No&#8221;) %&#62;&#8217; runat=&#8221;server&#8221; /&#62; Also Bind will not work if you are databinding it. Here is another example where I used code behind. in Aspx : &#60;asp:RadioButtonList ID=&#8221;rbGLRSearch&#8221; runat=&#8221;server&#8221; RepeatDirection=&#8221;Horizontal&#8221; OnSelectedIndexChanged=&#8221;EnableCluster&#8221; AutoPostBack=&#8221;true&#8221; SelectedValue=&#8217;&#60;%# GetCheckBoxValue(Eval(&#8220;GLRSearch&#8221;)) %&#62;&#8217;&#62; &#60;asp:ListItem&#62;Yes&#60;/asp:ListItem&#62; ]]></description>
			<content:encoded><![CDATA[<p>I had to display Yes or No based on databind this is how I did it.</p>
<p>&lt;asp:Label ID=&#8221;IsUserActiveCheckBox&#8221; Text=&#8217;&lt;%# if(Eval(&#8220;IsUserActive&#8221;),&#8221;Yes&#8221;,&#8221;No&#8221;) %&gt;&#8217;<br />
runat=&#8221;server&#8221; /&gt;</p>
<p>Also Bind will not work if you are databinding it.</p>
<p><strong>Here is another example where I used code behind.</strong></p>
<p><strong><span style="text-decoration: underline;">in Aspx : </span></strong></p>
<p>&lt;asp:RadioButtonList ID=&#8221;rbGLRSearch&#8221; runat=&#8221;server&#8221; RepeatDirection=&#8221;Horizontal&#8221;<br />
OnSelectedIndexChanged=&#8221;EnableCluster&#8221; AutoPostBack=&#8221;true&#8221; SelectedValue=&#8217;&lt;%# GetCheckBoxValue(Eval(&#8220;GLRSearch&#8221;)) %&gt;&#8217;&gt;<br />
&lt;asp:ListItem&gt;Yes&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem&gt;No&lt;/asp:ListItem&gt;<br />
&lt;asp:ListItem&gt;N/A&lt;/asp:ListItem&gt;<br />
&lt;/asp:RadioButtonList&gt;</p>
<p><strong><span style="text-decoration: underline;">in code behind :</span></strong></p>
<p>Protected Function GetCheckBoxValue(ByVal bool) As String</p>
<p>If bool Is Nothing Then<br />
Return &#8220;N/A&#8221;<br />
ElseIf bool = True Then<br />
Return &#8220;Yes&#8221;<br />
ElseIf bool = False Then<br />
Return &#8220;No&#8221;<br />
End If<br />
Return True<br />
End Function</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2008/12/01/how-to-use-code-behind-to-display-text-on-binding/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax CalanderExtender :Display dates of current (selected) month only</title>
		<link>http://blogs.myhappymoments.com/2008/11/26/ajax-calanderextender-show-dates/</link>
		<comments>http://blogs.myhappymoments.com/2008/11/26/ajax-calanderextender-show-dates/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 03:27:59 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[Ajax]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=201</guid>
		<description><![CDATA[Today I have decided that I will start writting one post everyday. Lets see how far I go. Today only one bug( rather a minor change) was requested by our clients doing UAT. Problem : We have ajax calanderextender and it shows all the dates for the selected month. Solution : So rather than doing ]]></description>
			<content:encoded><![CDATA[<p>Today I have decided that I will start writting one post everyday. Lets see how far I go.</p>
<p>Today only one bug( rather a minor change) was requested by our clients doing UAT.</p>
<p><strong>Problem</strong> : We have ajax calanderextender and it shows all the dates for the selected month.</p>
<p><strong>Solution</strong> : So rather than doing something in the code the best thing to do was just try and chage the CSS.</p>
<p><span id="more-201"></span>And it did work like charm.<br />
I added following lines to the CSS.<br />
<code><br />
.MyCalendar .ajax__calendar_other .ajax__calendar_day,</code></p>
<p><code> .MyCalendar .ajax__calendar_other .ajax__calendar_year<br />
{<br />
color: White;&lt;!--  Select What ever colour you want --&gt;<br />
}</code></p>
<p>And the problem was fixed without messing the CalanderExtender.</p>
<p>Thank you.</p>
<p>Vishal</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2008/11/26/ajax-calanderextender-show-dates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some Top Must-Have Tools for an ASP.NET Developer</title>
		<link>http://blogs.myhappymoments.com/2008/11/19/some-top-must-have-tools-for-an-aspnet-developer/</link>
		<comments>http://blogs.myhappymoments.com/2008/11/19/some-top-must-have-tools-for-an-aspnet-developer/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 00:04:33 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=194</guid>
		<description><![CDATA[Came across this blogs. really good collection of tools. worth trying them. http://www.dotnetcurry.com/(X(1)S(ksuw3045ka04q3rcittjc0nk))/ShowArticle.aspx?ID=103&#38;AspxAutoDetectCookieSupport]]></description>
			<content:encoded><![CDATA[<p>Came across this blogs.</p>
<p>really good collection of tools.</p>
<p>worth trying them.</p>
<p><a href="http://www.dotnetcurry.com/(X(1)S(ksuw3045ka04q3rcittjc0nk))/ShowArticle.aspx?ID=103&amp;AspxAutoDetectCookieSupport=1">http://www.dotnetcurry.com/(X(1)S(ksuw3045ka04q3rcittjc0nk))/ShowArticle.aspx?ID=103&amp;AspxAutoDetectCookieSupport=1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2008/11/19/some-top-must-have-tools-for-an-aspnet-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Performance Tips for ASP.NET Applications</title>
		<link>http://blogs.myhappymoments.com/2008/11/19/performance-tips-for-aspnet-applications/</link>
		<comments>http://blogs.myhappymoments.com/2008/11/19/performance-tips-for-aspnet-applications/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 23:21:49 +0000</pubDate>
		<dc:creator>Vish</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">http://blogs.myhappymoments.com/?p=191</guid>
		<description><![CDATA[I found this article while looking for improving the performance of ASP.NET for one of my application. Its really good one. I am going to try some of the stuff and see if there is a difference in performance. Here;s the link to the blog http://blogs.microsoft.co.il/blogs/rotemb/archive/2008/08/17/performance-tips-for-asp-net-applications.aspx http://blogs.microsoft.co.il/blogs/rotemb/archive/2008/07/29/tune-your-net-application-that-suffer-from-contention-poor-performance-and-deadlocks.aspx]]></description>
			<content:encoded><![CDATA[<p>I found this article while looking for improving the performance of ASP.NET for one of my application.</p>
<p>Its really good one.</p>
<p>I am going to try some of the stuff and see if there is a difference in performance.</p>
<p>Here;s the link to the blog</p>
<p><a href="http://blogs.microsoft.co.il/blogs/rotemb/archive/2008/08/17/performance-tips-for-asp-net-applications.aspx" target="_blank">http://blogs.microsoft.co.il/blogs/rotemb/archive/2008/08/17/performance-tips-for-asp-net-applications.aspx</a></p>
<p><a href="http://blogs.microsoft.co.il/blogs/rotemb/archive/2008/07/29/tune-your-net-application-that-suffer-from-contention-poor-performance-and-deadlocks.aspx" target="_blank">http://blogs.microsoft.co.il/blogs/rotemb/archive/2008/07/29/tune-your-net-application-that-suffer-from-contention-poor-performance-and-deadlocks.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.myhappymoments.com/2008/11/19/performance-tips-for-aspnet-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
