<?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/"
	>

<channel>
	<title>Ajiths blog</title>
	<atom:link href="http://www.ajithnet.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajithnet.info</link>
	<description>.Net /SQL for all</description>
	<pubDate>Mon, 05 Jul 2010 05:36:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>My homecoming - Thank you for your presence</title>
		<link>http://www.ajithnet.info/2010/06/01/my-homecomming-thank-you-for-your-presence/</link>
		<comments>http://www.ajithnet.info/2010/06/01/my-homecomming-thank-you-for-your-presence/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 17:43:58 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=212</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-211" href="http://www.ajithnet.info/2010/06/01/my-homecomming-thank-you-for-your-presence/eranga-4r-200-copy-copy5555/"><img class="alignleft size-medium wp-image-211" title="eranga-4r-200-copy-copy5555" src="http://www.ajithnet.info/wp-content/uploads/2010/06/eranga-4r-200-copy-copy5555-300x200.jpg" alt="eranga-4r-200-copy-copy5555" width="300" height="200" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2010/06/01/my-homecomming-thank-you-for-your-presence/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Happy New Year</title>
		<link>http://www.ajithnet.info/2009/12/31/happy-new-year-2/</link>
		<comments>http://www.ajithnet.info/2009/12/31/happy-new-year-2/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 19:19:59 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[Information]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=198</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-199" href="http://www.ajithnet.info/2009/12/31/happy-new-year-2/ajith/"><img class="alignleft size-large wp-image-199" title="Happy New Year 2010" src="http://www.ajithnet.info/wp-content/uploads/2009/12/ajith-682x1024.jpg" alt="Happy New Year 2010" width="341" height="512" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/12/31/happy-new-year-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Blood &amp; Medicine Donation program</title>
		<link>http://www.ajithnet.info/2009/10/15/httpjoin4donategooglepagescom/</link>
		<comments>http://www.ajithnet.info/2009/10/15/httpjoin4donategooglepagescom/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 17:55:25 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=192</guid>
		<description><![CDATA[Thanks everyone for your great support. See more details @
http://join4donate.googlepages.com/
]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: Times New Roman; color: #000080; font-size: small;">Thanks everyone for your great support. See more details @</span></p>
<p><a href="http://join4donate.googlepages.com/">http://join4donate.googlepages.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/10/15/httpjoin4donategooglepagescom/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sri Lanka Microsoft Bowling Challange</title>
		<link>http://www.ajithnet.info/2009/08/19/sri-lanka-microsoft-bowling-challange/</link>
		<comments>http://www.ajithnet.info/2009/08/19/sri-lanka-microsoft-bowling-challange/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 15:28:56 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=183</guid>
		<description><![CDATA[ It is great plesure that our team( (Team “Rolling Stones”  ) won the Microsoft Tech Communities bowling competition on August 15th, 2009.
]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-184" href="http://www.ajithnet.info/2009/08/19/sri-lanka-microsoft-bowling-challange/pic/"></a> It is great plesure that our team( (Team “Rolling Stones” <img src='http://www.ajithnet.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ) won the Microsoft Tech Communities bowling competition on <span class="UIIntentionalStory_Time">August 15th, 2009</span>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/08/19/sri-lanka-microsoft-bowling-challange/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Inserted and deleted tables in SQL2005</title>
		<link>http://www.ajithnet.info/2009/08/18/inserted-and-deleted-tables-in-sql2005/</link>
		<comments>http://www.ajithnet.info/2009/08/18/inserted-and-deleted-tables-in-sql2005/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 18:54:41 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=168</guid>
		<description><![CDATA[Inserted and deleted tables are mainly used inside triggers. But with OUTPUT clause , we can access above virtual tables. That is actually usefull to reduce number of lines when we write quearies. Thanks Aneef for showing me this. I would like to share it with you. Lets try to undestand it using following queary.
/* [...]]]></description>
			<content:encoded><![CDATA[<p>Inserted and deleted tables are mainly used inside triggers. But with OUTPUT clause , we can access above virtual tables. That is actually usefull to reduce number of lines when we write quearies. Thanks <a href="http://www.aneef.net" target="_blank">Aneef </a>for showing me this. I would like to share it with you. Lets try to undestand it using following queary.</p>
<p><span style="color: #0000ff;"><span style="color: #808080;">/* Create table*/</span><br />
CREATE TABLE Table1 (AutoID INT IDENTITY(1,1) NOT NULL,SampleText VARCHAR(100))</span></p>
<p><span style="color: #0000ff;"><span style="color: #808080;">/*Create temp table*/</span><br />
DECLARE @TmpTable TABLE (ID INT, SampleText VARCHAR(100),[message] VARCHAR(100))</span></p>
<p><span style="color: #0000ff;"><span style="color: #808080;">/*Insert record to Table1 and select inserted records*/</span><br />
INSERT Table1 (SampleText)<br />
OUTPUT Inserted.AutoID, Inserted.SampleText<br />
VALUES (&#8217;Sample value1&#8242;)</span></p>
<p><span style="color: #0000ff;"><span style="color: #808080;">/*Insert record to Table1 and insert record to temp table with inserted new ID*/<br />
</span>INSERT Table1 (SampleText)<br />
OUTPUT Inserted.AutoID, Inserted.SampleText,&#8217;Inserted&#8217; INTO @TmpTable<br />
VALUES (&#8217;Sample value2&#8242;)</span></p>
<p><span style="color: #0000ff;"><span style="color: #808080;">/*Insert record to Table1 and insert record to temp table with inserted new ID*/<br />
</span>INSERT Table1 (SampleText)<br />
OUTPUT Inserted.AutoID, Inserted.SampleText,&#8217;Inserted&#8217; INTO @TmpTable<br />
VALUES (&#8217;Sample value3&#8242;)</span></p>
<p><span style="color: #0000ff;"><span style="color: #808080;">/*Select and see data in both tables*/</span><br />
SELECT * FROM @TmpTable<br />
SELECT * FROM Table1</span></p>
<p><span style="color: #808080;">/*Check how deleted table works*/</span></p>
<p><span style="color: #0000ff;">UPDATE Table1<br />
SET SampleText = &#8216;Sample value1&#8242;<br />
OUTPUT Deleted.AutoID, Deleted.SampleText,&#8217;Deleted record&#8217; INTO @TmpTable<br />
WHERE SampleText=&#8217;Sample value1&#8242;</span></p>
<p><span style="color: #0000ff;">UPDATE Table1<br />
SET SampleText = &#8216;SampleText&#8217;<br />
OUTPUT Inserted.AutoID, Inserted.SampleText,&#8217;Updated new record&#8217; INTO @TmpTable<br />
WHERE SampleText=&#8217;Sample value1&#8242;</span></p>
<p><span style="color: #0000ff;">SELECT * FROM @TmpTable<br />
SELECT * FROM Table1<br />
<span style="color: #808080;">/*put deleted record to temp table*/</span></span></p>
<p><span style="color: #0000ff;">DELETE<br />
FROM Table1<br />
OUTPUT Deleted.AutoID, Deleted.SampleText,&#8217;Deleted record&#8217; INTO @TmpTable<br />
WHERE SampleText=&#8217;SampleText&#8217;</span></p>
<p><span style="color: #0000ff;">SELECT * FROM @TmpTable<br />
SELECT * FROM Table1</span></p>
<p><span style="color: #0000ff;"><span style="color: #808080;">&#8211;DROP TABLES</span><br />
DROP TABLE Table1</span></p>
<p><a rel="attachment wp-att-176" href="http://www.ajithnet.info/2009/08/18/inserted-and-deleted-tables-in-sql2005/sample/">Sample SQL</a> (download queary)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/08/18/inserted-and-deleted-tables-in-sql2005/feed/</wfw:commentRss>
		</item>
		<item>
		<title>image watermarking using C#</title>
		<link>http://www.ajithnet.info/2009/06/25/image-watermarking-using-c/</link>
		<comments>http://www.ajithnet.info/2009/06/25/image-watermarking-using-c/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 18:12:24 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=144</guid>
		<description><![CDATA[It was more than 3 weeks since my last post, I thought to have blog post about image watermarking as last week I wanted that feature for a website requirement. Even I thought that is a big case, I could do it with couple of  lines. Here see the code of lines for that.
First of [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="font-size: x-small;">It was more than 3 weeks since my last post, I thought to have blog post about image watermarking as last week I wanted that feature for a website requirement. Even I thought that is a big case, I could do it with couple of  lines. Here see the code of lines for that.<br />
First of all following namespaces are required for the code.<br />
</span><span style="font-size: x-small;">System.Drawing</span><br />
<span style="font-size: x-small;">System.Drawing.Drawing2D</span><br />
<span style="font-size: x-small;">System.Drawing.Imaging</span><br />
<span style="font-size: x-small;">Code:</span></h1>
<h3><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">string </span></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #000000;">Imagefile = </span><span style="font-size: x-small; color: #800000;">@&#8221;E:\projects\Watermarking\112.jpg&#8221;</span></span></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small;"><span style="color: #000000;">;//</span></span></span></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small;"><span style="color: #000000;">image path</span><span style="font-size: x-small;"> </span></span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span></span></span></h3>
<h3><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"></span></span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><span style="font-size: x-small; color: #008080;">Image</span><span style="font-size: x-small;"> img = </span><span style="font-size: x-small; color: #008080;">Image</span><span style="font-size: x-small;">.FromFile(Imagefile);// Create image object<span style="font-size: x-small;"> </span></span><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span></h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span><span style="font-size: x-small; color: #008080;">Graphics</span><span style="font-size: x-small;"> g = </span><span style="font-size: x-small; color: #008080;">Graphics</span><span style="font-size: x-small;">.FromImage(img); //Create graphics object</span><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span></span></h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small; color: #008080;">Color</span><span style="font-size: x-small;"> WatermarkColor = </span><span style="font-size: x-small; color: #008080;">Color</span><span style="font-size: x-small;">.FromArgb(200, 84, 84, 84); //color with alpha </span></span></span></span><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span></span></span></h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small; color: #008080;">Font</span><span style="font-size: x-small;"> font = </span><span style="font-size: x-small; color: #0000ff;">new</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #008080;">Font</span><span style="font-size: x-small;">(</span><span style="font-size: x-small; color: #800000;">&#8220;Times New Roman&#8221;</span><span style="font-size: x-small;">, 50,</span><span style="font-size: x-small; color: #008080;">FontStyle</span></span></span></span><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;">.Italic);<span style="font-size: x-small;"> </span></span></span></span></span></h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small; color: #008080;">Brush</span><span style="font-size: x-small;"> brush = </span><span style="font-size: x-small; color: #0000ff;">new</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #008080;">SolidBrush<span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="color: #000000;"> </span></span></span></span></span><span style="font-size: x-small;"><span style="color: #000000;">(WatermarkColor);<span style="font-size: x-small;"> </span></span></span></span><span style="color: #000000;"> </span></span></span></span></h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small; color: #0000ff;">string</span><span style="font-size: x-small;"> WaterMarkString = </span><span style="font-size: x-small; color: #800000;">&#8220;this is sample text&#8221;</span></span></span><span style="font-size: x-small;">;<span style="font-size: x-small;"> </span></span></h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small; color: #008080;">SizeF</span><span style="font-size: x-small;"> sz = g.MeasureString(WaterMarkString, font);</span></span></span> </h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;">g.DrawString(WaterMarkString, font, brush,</span></span></span></h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small; color: #0000ff;">new</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #008080;">Point</span><span style="font-size: x-small;">(X, Y));// Draw image with lable.</span></span></span></span><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"> </span></span></span> </h3>
<h3><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;">img.Save(</span></span></span><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small;"><span style="font-size: x-small; color: #800000;">&#8220;image.jpg&#8221;</span><span style="font-size: x-small;">);// save image</span></span></span></span></h3>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/06/25/image-watermarking-using-c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Post an HTML form to ASP.NET Page</title>
		<link>http://www.ajithnet.info/2009/05/27/post-an-html-form-to-aspnet-page/</link>
		<comments>http://www.ajithnet.info/2009/05/27/post-an-html-form-to-aspnet-page/#comments</comments>
		<pubDate>Wed, 27 May 2009 19:07:44 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[ASP.NET]]></category>

		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=138</guid>
		<description><![CDATA[For a web application we wanted to post html page to an ASP.NET page. So I thought of having a blog post about that. 
                             First of all open visual studio and create ASP.NET project. After that you can do rest according to below steps.
1)      Create HTML page.
2)       Insert form tags and define form method(post) [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-size: small; font-family: Calibri;">For a web application we wanted to post html page to an ASP.NET page. So I thought of having a blog post about that. </span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-size: small;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;">                        </span><span style="mso-spacerun: yes;">     </span>First of all open visual studio and create ASP.NET project. After that you can do rest according to below steps.</span></span></p>
<p class="MsoListParagraphCxSpFirst" style="margin: 0cm 0cm 0pt 19.5pt; text-indent: -18pt; mso-add-space: auto; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size: small; font-family: Calibri;">1)</span><span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: small; font-family: Calibri;">Create HTML page.</span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0pt 19.5pt; text-indent: -18pt; mso-add-space: auto; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size: small; font-family: Calibri;">2)</span><span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: small;"><span style="font-family: Calibri;"><span style="mso-spacerun: yes;"> </span>Insert form tags and define form method(post) and action(ASP.NET page) </span></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0pt 19.5pt; text-indent: -18pt; mso-add-space: auto; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size: small; font-family: Calibri;">3)</span><span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: small; font-family: Calibri;">Add html controls to the form.</span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0pt 19.5pt; text-indent: -18pt; mso-add-space: auto; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size: small; font-family: Calibri;">4)</span><span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: small; font-family: Calibri;">Create ASP.NET page for submit HTML form.</span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0pt 19.5pt; text-indent: -18pt; mso-add-space: auto; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size: small; font-family: Calibri;">5)</span><span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: small; font-family: Calibri;">Set project startup page to HTML page.</span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin: 0cm 0cm 0pt 19.5pt; text-indent: -18pt; mso-add-space: auto; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size: small; font-family: Calibri;">6)</span><span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: small; font-family: Calibri;">In ASP.NET page load, you can get all keys of HTML page by </span><strong style="mso-bidi-font-weight: normal;"><span style="font-size: 10pt; color: black; line-height: 115%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Request.Form.AllKeys</span></strong><span style="font-size: 10pt; color: black; line-height: 115%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">. </span></p>
<p class="MsoListParagraphCxSpLast" style="margin: 0cm 0cm 10pt 19.5pt; text-indent: -18pt; mso-add-space: auto; mso-list: l0 level1 lfo1;"><span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin;"><span style="mso-list: Ignore;"><span style="font-size: small; font-family: Calibri;">7)</span><span style="font: 7pt &quot;Times New Roman&quot;;">      </span></span></span><span style="font-size: 10pt; color: black; line-height: 115%; font-family: &quot;Verdana&quot;,&quot;sans-serif&quot;;">Then you can get the HTML control data easily by using Request.Form[sKey];</span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-size: small; font-family: Calibri;"><a href="http://www.ajithnet.info/2009/05/27/post-an-html-form-to-aspnet-page/htmlpost2aspnet/" target="_blank">Download </a>the attached project <span style="mso-spacerun: yes;"> </span>to get better idea about this.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/05/27/post-an-html-form-to-aspnet-page/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Let’s get together all</title>
		<link>http://www.ajithnet.info/2009/05/18/peace-in-sri-lanka/</link>
		<comments>http://www.ajithnet.info/2009/05/18/peace-in-sri-lanka/#comments</comments>
		<pubDate>Mon, 18 May 2009 17:55:24 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=134</guid>
		<description><![CDATA[Now we all know the latest news from Sri Lanka. The war is over.   
Let’s get together all Sinhala, Tamil and Muslim peoples as a one nation and build our country. 
]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;;">Now we all know the latest news from Sri Lanka. The war is over. <span style="mso-spacerun: yes;"> </span><span style="mso-spacerun: yes;"> </span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-size: 10pt; line-height: 115%; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;;">Let’s get together all Sinhala, Tamil and Muslim peoples as a one nation and build our country. </span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/05/18/peace-in-sri-lanka/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to search or replace string from right side</title>
		<link>http://www.ajithnet.info/2009/05/13/how-to-search-from-right-side/</link>
		<comments>http://www.ajithnet.info/2009/05/13/how-to-search-from-right-side/#comments</comments>
		<pubDate>Wed, 13 May 2009 12:25:40 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=121</guid>
		<description><![CDATA[Assume that you have comma separated names list and you want to replace last comma sign by string ‘and’, you can reverse string value and find the char index and do it as below(or download Script).   
DECLARE @StringList varchar(200)
DECLARE @index INT
DECLARE @lastWord varchar(100)
SET @StringList = &#8216;Aneef,Ajith,Gayan,Manoj,Jude,Julius&#8217;
SELECT @index=charindex(&#8217;,', reverse(@StringList))
SELECT @lastWord=right(@StringList,charindex(&#8217;,', reverse(@StringList)) -1)
SELECT SUBSTRING(@StringList,1,LEN(@StringList)-@index)+&#8217; and &#8216;+@lastWord
]]></description>
			<content:encoded><![CDATA[<p>Assume that you have comma separated names list and you want to replace last comma sign by string ‘and’, you can reverse string value and find the char index and do it as below(or download <a rel="attachment wp-att-129" href="http://www.ajithnet.info/2009/05/13/how-to-search-from-right-side/searchfromright/">Script</a>).   </p>
<p>DECLARE @StringList varchar(200)<br />
DECLARE @index INT<br />
DECLARE @lastWord varchar(100)<br />
SET @StringList = &#8216;Aneef,Ajith,Gayan,Manoj,Jude,Julius&#8217;<br />
SELECT @index=charindex(&#8217;,', reverse(@StringList))<br />
SELECT @lastWord=right(@StringList,charindex(&#8217;,', reverse(@StringList)) -1)<br />
SELECT SUBSTRING(@StringList,1,LEN(@StringList)-@index)+&#8217; and <a href="mailto:'+@lastWord">&#8216;+@lastWord</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/05/13/how-to-search-from-right-side/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQL cumulative calculations without looping</title>
		<link>http://www.ajithnet.info/2009/05/11/sql-cumulative-calculations-without-looping/</link>
		<comments>http://www.ajithnet.info/2009/05/11/sql-cumulative-calculations-without-looping/#comments</comments>
		<pubDate>Mon, 11 May 2009 19:03:50 +0000</pubDate>
		<dc:creator>Ajith Pushpakumara</dc:creator>
		
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ajithnet.info/?p=82</guid>
		<description><![CDATA[               I have seen several times some people use loops, cursors to do cumulative calculations. But I think we can use following basic way to do calculations without using loops or cursors .Just create sample table (run attached script) and try following SQL
DECLARE @tempValue FLOAT
SET @tempValue=1
UPDATE Sample SET @tempValue=CalculatedValue=(MonthlyValue+1)*@tempValue
SELECT * FROM Sample
Download Script
]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-weight: normal; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold;"><span style="font-size: small;"><span style="mso-spacerun: yes;">               </span>I have seen several times some people use loops, cursors to do cumulative calculations. But I think we can use following basic way to do calculations without using loops or cursors .Just create sample table (run attached script) and try following SQL<a rel="attachment wp-att-95" href="http://www.ajithnet.info/2009/05/11/sql-cumulative-calculations-without-looping/cumsample3/"><img class="alignleft size-medium wp-image-95" title="cumsample3" src="http://www.ajithnet.info/wp-content/uploads/2009/05/cumsample3-300x198.jpg" alt="cumsample3" width="300" height="198" /></a></span></span><span style="font-weight: normal; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold;"><span style="font-size: small;"></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-weight: normal; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold;"><span style="font-size: small;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">DECLARE </span></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small;">@tempValue </span><span style="font-size: x-small; color: #0000ff;">FLOAT</span></span></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-weight: normal; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold;"><span style="font-size: small;"><span style="font-size: x-small; color: #0000ff;"></span></span></span><span style="font-weight: normal; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold;"><span style="font-size: small;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">SET </span></span></span></span><span style="font-size: x-small;">@tempValue</span><span style="font-size: x-small; color: #808080;">=</span><span style="font-size: x-small;">1</span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-weight: normal; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold;"></span><span style="font-weight: normal; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold;"><span style="font-size: small;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">UPDATE </span></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small;">Sample </span><span style="font-size: x-small; color: #0000ff;">SET</span><span style="font-size: x-small;"> @tempValue</span><span style="font-size: x-small; color: #808080;">=</span><span style="font-size: x-small;">CalculatedValue</span><span style="font-size: x-small; color: #808080;">=(</span><span style="font-size: x-small;">MonthlyValue</span><span style="font-size: x-small; color: #808080;">+</span><span style="font-size: x-small;">1</span><span style="font-size: x-small; color: #808080;">)*</span><span style="font-size: x-small;">@tempValue</span></span></span></span></span></p>
<p class="MsoNormal" style="margin: 0cm 0cm 10pt;"><span style="font-weight: normal; color: black; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;; mso-bidi-font-weight: bold;"><span style="font-size: small;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"></span></span></span></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;">SELECT </span></span><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #808080;">*</span><span style="font-size: x-small;"> </span><span style="font-size: x-small; color: #0000ff;">FROM</span><span style="font-size: x-small;"> Sample</span></span></span></p>
<div><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small; color: #0000ff;"><span style="font-size: x-small;"><a href="http://www.ajithnet.info/2009/05/11/sql-cumulative-calculations-without-looping/createtableandinsertsampledata/" target="_blank">Download Script</a></span></span></span></div>
]]></content:encoded>
			<wfw:commentRss>http://www.ajithnet.info/2009/05/11/sql-cumulative-calculations-without-looping/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
