<?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>Private: Code &#38; Script Snippet &#187; .NET</title>
	<atom:link href="http://dev.kratik.net/index.php/category/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.kratik.net</link>
	<description>Every thing you imagin, study it - know it - use it</description>
	<lastBuildDate>Thu, 24 Jun 2010 08:30:01 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Send  SqlDbType.Xml to Store Procedure</title>
		<link>http://dev.kratik.net/index.php/2009/12/21/send-sqldbtype-xml-to-store-procedure/</link>
		<comments>http://dev.kratik.net/index.php/2009/12/21/send-sqldbtype-xml-to-store-procedure/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 03:19:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://dev.kratik.net/?p=857</guid>
		<description><![CDATA[<p>SqlCommand command = new SqlCommand(&#8221;ReportMultiTruckGeneric&#8221;);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(&#8221;@startDate&#8221;, SqlDbType.DateTime).Value = ProcessStartDate;
command.Parameters.Add(&#8221;@endDate&#8221;, SqlDbType.DateTime).Value = ProcessEndDate;</p>
<p>StringBuilder sb = new StringBuilder();</p>
<p>sb.Append(&#8221;&#60;Trucks&#62;&#8221;);
foreach (DataRow row in trucks.Tables[0].Rows)
{
sb.AppendFormat(&#8221;&#60;TruckId&#62;{0}&#60;/TruckId&#62;&#8221;, row["ID"].ToString());
}
sb.Append(&#8221;&#60;/Trucks&#62;&#8221;);</p>
<p>command.Parameters.Add(&#8221;@trucks&#8221;, SqlDbType.Xml).Value = sb.ToString();</p>
<p>DataSet queryResult = DBHook.SendSQLSelectRequest(command, out ex);</p>
<p>==store procedure=============
ALTER procedure [dbo].[ReportMultiTruckGeneric]
@startDate datetime,
@endDate datetime,
@trucks xml
as</p>
<p>&#8230;
set @trucksCopy = @trucks
&#8230;</p>
<p>select Trucks.TruckId.value(&#8217;.', &#8216;int&#8217;)
from @trucksCopy.nodes(&#8217;Trucks/TruckId&#8217;) as Trucks(TruckId)</p>
]]></description>
			<content:encoded><![CDATA[<p>SqlCommand command = new SqlCommand(&#8221;ReportMultiTruckGeneric&#8221;);<br />
command.CommandType = CommandType.StoredProcedure;<br />
command.Parameters.Add(&#8221;@startDate&#8221;, SqlDbType.DateTime).Value = ProcessStartDate;<br />
command.Parameters.Add(&#8221;@endDate&#8221;, SqlDbType.DateTime).Value = ProcessEndDate;</p>
<p>StringBuilder sb = new StringBuilder();</p>
<p>sb.Append(&#8221;&lt;Trucks&gt;&#8221;);<br />
foreach (DataRow row in trucks.Tables[0].Rows)<br />
{<br />
sb.AppendFormat(&#8221;&lt;TruckId&gt;{0}&lt;/TruckId&gt;&#8221;, row["ID"].ToString());<br />
}<br />
sb.Append(&#8221;&lt;/Trucks&gt;&#8221;);</p>
<p><strong><span style="color: #ff0000;">command.Parameters.Add(&#8221;@trucks&#8221;, SqlDbType.Xml).Value = sb.ToString();</span></strong></p>
<p>DataSet queryResult = DBHook.SendSQLSelectRequest(command, out ex);</p>
<p>==store procedure=============<br />
ALTER procedure [dbo].[ReportMultiTruckGeneric]<br />
@startDate datetime,<br />
@endDate datetime,<br />
<span style="color: #ff0000;">@trucks xml</span><br />
as</p>
<p>&#8230;<br />
<span style="color: #ff0000;">set @trucksCopy = @trucks</span><br />
&#8230;</p>
<p>select Trucks.TruckId.value(&#8217;.', &#8216;int&#8217;)<br />
from <span style="color: #ff0000;">@trucksCopy</span>.nodes(&#8217;Trucks/TruckId&#8217;) as Trucks(TruckId)</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/12/21/send-sqldbtype-xml-to-store-procedure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Multi Thread and Delegate</title>
		<link>http://dev.kratik.net/index.php/2009/12/08/multi-thread-and-delegate/</link>
		<comments>http://dev.kratik.net/index.php/2009/12/08/multi-thread-and-delegate/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 19:08:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://dev.kratik.net/?p=853</guid>
		<description><![CDATA[จากรูปข้างล่างนี้เราสามารถที่จะเลือกใส่ทั้ง IP Address , HostName, DNS เพื่อทำการ Ping ได้ครับ

<p>http://greatfriends.biz/webboards/msg.asp?b=SURREALIST&#38;id=21512</p>
<p>http://greatfriends.biz/webboards/msg.asp?b=SURREALIST&#38;id=21512</p>
<p>http://greatfriends.biz/webboards/msg.asp?id=16216</p>
]]></description>
			<content:encoded><![CDATA[<div>จากรูปข้างล่างนี้เราสามารถที่จะเลือกใส่ทั้ง IP Address , HostName, DNS เพื่อทำการ Ping ได้ครับ</div>
<div><img src="http://greatfriends.biz/upload/imgs7/pingitvb.JPG" border="1" alt="" hspace="0" vspace="5" align="baseline" /></div>
<p>http://greatfriends.biz/webboards/msg.asp?b=SURREALIST&amp;id=21512</p>
<p>http://greatfriends.biz/webboards/msg.asp?b=SURREALIST&amp;id=21512</p>
<p>http://greatfriends.biz/webboards/msg.asp?id=16216</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/12/08/multi-thread-and-delegate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio Programmer Themes Gallery</title>
		<link>http://dev.kratik.net/index.php/2009/11/23/visual-studio-programmer-themes-gallery/</link>
		<comments>http://dev.kratik.net/index.php/2009/11/23/visual-studio-programmer-themes-gallery/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 05:51:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET 3.5]]></category>

		<guid isPermaLink="false">http://dev.kratik.net/?p=811</guid>
		<description><![CDATA[<p></p>
<p>See more themes goto link below</p>
<p>http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx
http://blog.wekeroad.com/2007/10/17/textmate-theme-for-visual-studio-take-2/</p>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.hanselman.com/blog/content/binary/WindowsLiveWriter/VisualStudioProgrammerThemesGallery_CF56/image_13.png"><img style="border-width: 0px;" src="http://www.hanselman.com/blog/content/binary/WindowsLiveWriter/VisualStudioProgrammerThemesGallery_CF56/image_thumb_4.png" border="0" alt="image" width="504" height="406" /></a></p>
<p>See more themes goto link below</p>
<p><a href="http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx">http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx</a><br />
<a href="http://blog.wekeroad.com/2007/10/17/textmate-theme-for-visual-studio-take-2/">http://blog.wekeroad.com/2007/10/17/textmate-theme-for-visual-studio-take-2/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/11/23/visual-studio-programmer-themes-gallery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unable to start debugging on the web server. You do not have permission to debug the application. The URL for this project is in the Internet zone.</title>
		<link>http://dev.kratik.net/index.php/2009/11/02/unable-to-start-debugging-on-the-web-server-you-do-not-have-permission-to-debug-the-application-the-url-for-this-project-is-in-the-internet-zone/</link>
		<comments>http://dev.kratik.net/index.php/2009/11/02/unable-to-start-debugging-on-the-web-server-you-do-not-have-permission-to-debug-the-application-the-url-for-this-project-is-in-the-internet-zone/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 09:48:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://dev.kratik.net/?p=782</guid>
		<description><![CDATA[<p>1. In the Internet Explorer, &#8220;Tools&#8221; Menu, select &#8220;Internet Options&#8221;.</p>
<p>2. Switch to &#8220;Security&#8221; Tab.</p>
<p>3. Click on &#8220;Internet&#8221; (The Globe Icon. Its actually the default selected).</p>
<p>4. Click on &#8220;Custom Level&#8221; in the bottom.</p>
<p>5. Scroll down to find the &#8220;User Authentication&#8221; section.</p>
<p>6. Select &#8220;Automatic logon with current username and password&#8221;.</p>
<p>7. Click &#8220;Ok&#8221; twice to exit.</p>
<p>ref:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vsdebug.asp</p>
]]></description>
			<content:encoded><![CDATA[<p>1. In the Internet Explorer, &#8220;Tools&#8221; Menu, select &#8220;Internet Options&#8221;.</p>
<p>2. Switch to &#8220;Security&#8221; Tab.</p>
<p>3. Click on &#8220;Internet&#8221; (The Globe Icon. Its actually the default selected).</p>
<p>4. Click on &#8220;Custom Level&#8221; in the bottom.</p>
<p>5. Scroll down to find the &#8220;User Authentication&#8221; section.</p>
<p>6. Select &#8220;Automatic logon with current username and password&#8221;.</p>
<p>7. Click &#8220;Ok&#8221; twice to exit.</p>
<p>ref:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vsdebug.asp</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/11/02/unable-to-start-debugging-on-the-web-server-you-do-not-have-permission-to-debug-the-application-the-url-for-this-project-is-in-the-internet-zone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Dynamic Data Preview #7: How Do I Use a DynamicControl in ListView and DetailsView Controls?</title>
		<link>http://dev.kratik.net/index.php/2009/09/30/asp-net-dynamic-data-preview-7-how-do-i-use-a-dynamiccontrol-in-listview-and-detailsview-controls/</link>
		<comments>http://dev.kratik.net/index.php/2009/09/30/asp-net-dynamic-data-preview-7-how-do-i-use-a-dynamiccontrol-in-listview-and-detailsview-controls/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 07:15:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://dev1.wordpress.com/?p=595</guid>
		<description><![CDATA[<p>This video compares the same application written twice, once with Dynamic Data and once without. In the process, you add DynamicControl objects to ListView and DetailsView controls.</p>
<p>http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.dynamiccontrol.aspx</p>
<p>http://www.bestechvideos.com/2008/06/02/asp-net-dynamic-data-how-do-i-use-a-dynamiccontrol-in-listview-and-detailsview-controls</p>
]]></description>
			<content:encoded><![CDATA[<p>This video compares the same application written twice, once with Dynamic Data and once without. In the process, you add DynamicControl objects to ListView and DetailsView controls.</p>
<p><a class="alignleft" href="http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.dynamiccontrol.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/system.web.dynamicdata.dynamiccontrol.aspx</a></p>
<p>http://www.bestechvideos.com/2008/06/02/asp-net-dynamic-data-how-do-i-use-a-dynamiccontrol-in-listview-and-detailsview-controls</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/09/30/asp-net-dynamic-data-preview-7-how-do-i-use-a-dynamiccontrol-in-listview-and-detailsview-controls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorting Generic List</title>
		<link>http://dev.kratik.net/index.php/2009/09/16/sorting-generic-list/</link>
		<comments>http://dev.kratik.net/index.php/2009/09/16/sorting-generic-list/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 10:17:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://dev1.wordpress.com/?p=582</guid>
		<description><![CDATA[//Sorting List&#60;&#62; case Item is ListItem
//==============================================
List&#60;ListItem&#62; tempList = new List&#60;ListItem&#62;();

tempList.Insert(0, new ListItem("------------- Vehicle Reports 8"));
tempList.Insert(0, new ListItem("------------- Vehicle Reports 2"));
tempList.Insert(0, new ListItem("------------- Vehicle Reports 4"));

// sort asc
tempList.Sort(delegate(ListItem p1, ListItem p2) {
                    return p1.Text.CompareTo(p2.Text);
    [...]]]></description>
			<content:encoded><![CDATA[<pre><span style="color:Green;font-family:Courier New;font-size:11px;background-color:White;">//Sorting List&lt;&gt; case Item is ListItem
//==============================================
</span>List&lt;ListItem&gt; tempList <span style="color:Red;font-family:Courier New;font-size:11px;background-color:White;">=</span> <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">new</span> List&lt;ListItem&gt;();

tempList.Insert(0, <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">new</span> ListItem(<span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"------------- Vehicle Reports 8"</span>));
tempList.Insert(0, <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">new</span> ListItem(<span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"------------- Vehicle Reports 2"</span>));
tempList.Insert(0, <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">new</span> ListItem(<span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"------------- Vehicle Reports 4"</span>));

<span style="color:Green;font-family:Courier New;font-size:11px;background-color:White;">// sort asc
</span>tempList.Sort(delegate(ListItem p1, ListItem p2) {
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">return</span> p1.Text.CompareTo(p2.Text);
                });
<span style="color:Green;font-family:Courier New;font-size:11px;background-color:White;">// sort desc
</span>tempList.Sort(delegate(ListItem p1, ListItem p2) {
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">return</span> p2.Text.CompareTo(p1.Text);
                });

<span style="color:Green;font-family:Courier New;font-size:11px;background-color:White;">//Sorting List&lt;&gt; case Item is Object Class
//===============================================
//Apply to sorting in GridView
//===============================================
SortData(e.SortExpression, NewSortDirection, ref listMsgTicker);
//===============================================
</span>
<span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">#region</span> method <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">for</span> sorting

    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">private</span> <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">void</span> SortData(<span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">string</span> _expression, SortDirection _direction,
            ref List&lt;MsgTicker&gt; data)
    {
        <span style="color:Green;font-family:Courier New;font-size:11px;background-color:White;">//sort asc ==
</span>        <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">if</span> (_direction == SortDirection.Ascending)
            data.Sort(delegate(MsgTicker a, MsgTicker b)
            {
                <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">switch</span> (_expression)
                {
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">case</span> <span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"MsgHeader"</span>: <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">return</span> a.MsgHeader.CompareTo(b.MsgHeader);
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">case</span> <span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"CreatedDate"</span>: <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">return</span> a.CreatedDate.CompareTo(b.CreatedDate);
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">case</span> <span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"ModifiedDate"</span>: <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">return</span> a.ModifiedDate.CompareTo(b.ModifiedDate);
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">default</span>:
                        throw <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">new</span> NotImplementedException(<span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"Type of property not implemented yet"</span>);
                }
            });

        <span style="color:Green;font-family:Courier New;font-size:11px;background-color:White;">//sort desc ==
</span>        <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">if</span> (_direction == SortDirection.Descending)
            data.Sort(delegate(MsgTicker a, MsgTicker b)
            {
                <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">switch</span> (_expression)
                {
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">case</span> <span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"MsgHeader"</span>: <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">return</span> b.MsgHeader.CompareTo(a.MsgHeader);
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">case</span> <span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"CreatedDate"</span>: <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">return</span> b.CreatedDate.CompareTo(a.CreatedDate);
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">case</span> <span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"ModifiedDate"</span>: <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">return</span> b.ModifiedDate.CompareTo(a.ModifiedDate);
                    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">default</span>:
                        throw <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">new</span> NotImplementedException(<span style="color:#666666;font-family:Courier New;font-size:11px;background-color:#ededed;">"Type of property not implemented yet"</span>);
                }
            });

        <span style="color:Green;font-family:Courier New;font-size:11px;background-color:White;">//return data;
</span>    }

    <span style="color:Blue;font-family:Courier New;font-size:11px;background-color:White;">#endregion
ref: </span>http://dotnetslackers.com/Community/blogs/simoneb/archive/2007/06/20/How-to-sort-a-generic-List_3C00_T_3E00_.aspx</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/09/16/sorting-generic-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ThaiBuddhistCalendar and DateTime Convertion</title>
		<link>http://dev.kratik.net/index.php/2009/09/08/thaibuddhistcalendar-and-datetime-convertion/</link>
		<comments>http://dev.kratik.net/index.php/2009/09/08/thaibuddhistcalendar-and-datetime-convertion/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 04:11:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://dev1.wordpress.com/?p=571</guid>
		<description><![CDATA[//date time utc
        DateTime _utc = DateTime.UtcNow;

        // utc --&#62; thai
        ThaiBuddhistCalendar tbc = new ThaiBuddhistCalendar();

        int thaiDay = tbc.GetDayOfMonth(_utc);
        [...]]]></description>
			<content:encoded><![CDATA[<pre><span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">//date time utc
</span>        DateTime _utc <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> DateTime.UtcNow;

        <span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">// utc --&gt; thai
</span>        ThaiBuddhistCalendar tbc <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">new</span> ThaiBuddhistCalendar();

        <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">int</span> thaiDay <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> tbc.GetDayOfMonth(_utc);
        <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">int</span> thaiMonth <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> tbc.GetMonth(_utc);
        <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">int</span> thaiYearr <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> tbc.GetYear(_utc);

        <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">string</span> thaiDaate <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> thaiDay.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"00"</span>) <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> <span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"/"</span> <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> thaiMonth.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"00"</span>) <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> <span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"/"</span> <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> thaiYearr.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"0000"</span>);

        <span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">// thai --&gt; utc
</span>        DateTime _do, _UtcTime;
        DateTime.TryParseExact(thaiDaate, <span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"dd/MM/yyyy"</span>, <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">new</span> CultureInfo(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"th-TH"</span>), DateTimeStyles.None, out _do);
        _UtcTime <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> _do.ToUniversalTime();
ref: <a href="http://msdn.microsoft.com/en-us/library/system.globalization.thaibuddhistcalendar.getera.aspx">http://msdn.microsoft.com/en-us/library/system.globalization.thaibuddhistcalendar.getera.aspx</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/09/08/thaibuddhistcalendar-and-datetime-convertion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert DateTime Thai &#8211; Eng culture (Buddha &#8211; Christ Ex. year 2009 is 2552)</title>
		<link>http://dev.kratik.net/index.php/2009/09/07/convert-datetime-thai-eng-culture-buddha-christ/</link>
		<comments>http://dev.kratik.net/index.php/2009/09/07/convert-datetime-thai-eng-culture-buddha-christ/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 15:08:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://dev1.wordpress.com/?p=567</guid>
		<description><![CDATA[public static  DateTime DateTimeCulture()
    {
        //=========================================================
        //======== convert year: crist to buddha ==================
        int _day, _month, _year;
        DateTime _date;
     [...]]]></description>
			<content:encoded><![CDATA[<pre><span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">public</span> <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">static</span>  DateTime DateTimeCulture()
    {
        <span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">//=========================================================
</span>        <span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">//======== convert year: crist to buddha ==================
</span>        <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">int</span> _day, _month, _year;
        DateTime _date;
        DateTime _dateRerurn;
        <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">string</span> strThaiDate; <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">string</span> strEndDate;

        _day <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> 2; _month <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> 12; _year <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> 2005;

        strEndDate <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> _day.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"00"</span>) <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> _month.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"00"</span>) <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> _year.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"0000"</span>);
        DateTime.TryParseExact(strEndDate, <span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"MM/dd/yyyy"</span>, <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">new</span> CultureInfo(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"en-US"</span>), DateTimeStyles.None, out _date);

        ThaiBuddhistCalendar b <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">new</span> ThaiBuddhistCalendar();
        <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">int</span> thaiYear <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> b.GetYear(_date); <span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">//(return year string buddha)&lt;----
</span>
        <span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">//=========================================================
</span>        <span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">//======== convert year: buddha to crist ==================
</span>        _day <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> b.GetDayOfMonth(_date);
        _month <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> b.GetMonth(_date);
        _year <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> b.GetYear(_date);

        <span style="font-size:11px;color:green;font-family:Courier New;background-color:white;">//_dateRerurn = b.ToDateTime(_year, _month, _day, 0, 0, 0, 0, ThaiBuddhistCalendar.ThaiBuddhistEra);
</span>        strThaiDate <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">=</span> _day.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"00"</span>) <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> <span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"/"</span> <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> _month.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"00"</span>) <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> <span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"/"</span> <span style="font-size:11px;color:red;font-family:Courier New;background-color:white;">+</span> _year.ToString(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"0000"</span>);
        DateTime.TryParseExact(strThaiDate, <span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"dd/MM/yyyy"</span>, <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">new</span> CultureInfo(<span style="font-size:11px;color:#666666;font-family:Courier New;background-color:#ededed;">"th-TH"</span>), DateTimeStyles.None, out _dateRerurn);

        <span style="font-size:11px;color:blue;font-family:Courier New;background-color:white;">return</span> _dateRerurn;
    }
ref: <a href="http://www1.cs.columbia.edu/~lok/csharp/refdocs/System.Globalization/types/DateTimeFormatInfo.html">http://www1.cs.columbia.edu/~lok/csharp/refdocs/System.Globalization/types/DateTimeFormatInfo.html</a>
ref: <a href="http://greatfriends.biz/webboards/msg.asp?id=8960">http://greatfriends.biz/webboards/msg.asp?id=8960</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/09/07/convert-datetime-thai-eng-culture-buddha-christ/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips to optimize design-time build performance for Web Sites in Visual Studio</title>
		<link>http://dev.kratik.net/index.php/2009/09/05/tips-to-optimize-design-time-build-performance-for-web-sites-in-visual-studio/</link>
		<comments>http://dev.kratik.net/index.php/2009/09/05/tips-to-optimize-design-time-build-performance-for-web-sites-in-visual-studio/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 13:22:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://dev1.wordpress.com/2009/09/05/tips-to-optimize-design-time-build-performance-for-web-sites-in-visual-studio/</guid>
		<description><![CDATA[<p>There have been a number of posts with tips to improve build performance within Visual Studio 2005.  I&#8217;ve consolidate these posts and other tips into a single post of techniques for common problems.
ref: http://weblogs.asp.net/bradleyb/archive/2005/12/06/432441.aspx</p>
]]></description>
			<content:encoded><![CDATA[<p>There have been a number of posts with tips to improve build performance within Visual Studio 2005.  I&#8217;ve consolidate these posts and other tips into a single post of techniques for common problems.<br />
ref: <a href="http://weblogs.asp.net/bradleyb/archive/2005/12/06/432441.aspx">http://weblogs.asp.net/bradleyb/archive/2005/12/06/432441.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/09/05/tips-to-optimize-design-time-build-performance-for-web-sites-in-visual-studio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LINQ to SQL Debug Visualizer</title>
		<link>http://dev.kratik.net/index.php/2009/09/05/linq-to-sql-debug-visualizer/</link>
		<comments>http://dev.kratik.net/index.php/2009/09/05/linq-to-sql-debug-visualizer/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 08:56:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://dev1.wordpress.com/?p=558</guid>
		<description><![CDATA[<p> Probably the biggest programming model improvement being made in .NET 3.5 is the work being done to make querying data a first class programming concept.  We call this overall querying programming model &#8220;LINQ&#8221;, which stands for .NET Language Integrated Query.  Developers can use LINQ with any data source, and built-in libraries are included with .NET 3.5 that [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:x-small;font-family:arial;"> Probably the biggest programming model improvement being made in .NET 3.5 is the work being done to make <em>querying data </em>a first class programming concept.  We call this overall querying programming model &#8220;LINQ&#8221;, which stands for <em>.NET Language Integrated Query</em>.  Developers can use LINQ with any data source, and built-in libraries are included with .NET 3.5 that enable LINQ support against Objects, XML, and Databases.</p>
<p>Earlier this summer I started writing a multi-part blog series that discusses the built-in LINQ to SQL provider in .NET 3.5.  LINQ to SQL is an <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">ORM</a> (object relational mapping) implementation that allows you to model a relational database using .NET classes.  You can then query the database using LINQ, as well as update/insert/delete data from it.  LINQ to SQL fully supports transactions, views, and stored procedures.  It also provides an easy way to integrate data validation and business logic rules into your data model.</p>
<p>You can learn more about LINQ to SQL by reading my posts below (more will be coming soon):</p>
<ul>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx" target="_blank">Part 1: Introduction to LINQ to SQL</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/05/29/linq-to-sql-part-2-defining-our-data-model-classes.aspx" target="_blank">Part 2: Defining our Data Model Classes</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/06/29/linq-to-sql-part-3-querying-our-database.aspx" target="_blank">Part 3: Querying our Database</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/07/11/linq-to-sql-part-4-updating-our-database.aspx" target="_blank">Part 4: Updating our Database</a></li>
<li><a href="http://weblogs.asp.net/scottgu/archive/2007/07/16/linq-to-sql-part-5-binding-ui-using-the-asp-linqdatasource-control.aspx" target="_blank">Part 5: Binding UI using the ASP:LinqDataSource Control</a></li>
</ul>
<h3><span style="text-decoration:underline;">Ref: <a href="http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx">http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx</a></span></h3>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.kratik.net/index.php/2009/09/05/linq-to-sql-debug-visualizer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
