<?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>家有小虎 &#187; .Net</title>
	<atom:link href="http://jiahu.net/tag/net/feed" rel="self" type="application/rss+xml" />
	<link>http://jiahu.net</link>
	<description>我在路上, 你不在身旁. 想你的时候, 温暖依然.</description>
	<lastBuildDate>Sun, 15 Jan 2012 03:12:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A summary of Filip Ekberg&#8217;s blog in 2011</title>
		<link>http://jiahu.net/a-summary-of-filip-ekbergs-blog-in-2011.htm</link>
		<comments>http://jiahu.net/a-summary-of-filip-ekbergs-blog-in-2011.htm#comments</comments>
		<pubDate>Sun, 15 Jan 2012 01:59:24 +0000</pubDate>
		<dc:creator>@ouc</dc:creator>
				<category><![CDATA[工作]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[书摘]]></category>

		<guid isPermaLink="false">http://jiahu.net/?p=1717</guid>
		<description><![CDATA[Let’s get to it, here’s a link summary to all Filip Ekbery&#8216;s posts in 2011 Dynamic programming Adding properties and methods to an ExpandoObject, dynamically! Extend your objects with DynamicObject to get a dynamic experience Invoke a dynamic object as &#8230; <a href="http://jiahu.net/a-summary-of-filip-ekbergs-blog-in-2011.htm">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Let’s get to it, here’s a link summary to all <a href="http://blog.csharptutor.com/2012/01/05/a-summary-of-2011-and-a-look-at-what-is-about-to-come/" target="_blank">Filip Ekbery</a>&#8216;s posts in 2011</p>
<p><strong>Dynamic programming</strong></p>
<ul>
<li><a title="Adding properties and methods to an ExpandoObject, dynamically! " href="http://blog.filipekberg.se/2011/10/02/adding-properties-and-methods-to-an-expandoobject-dynamicly/" target="_blank">Adding properties and methods to an ExpandoObject, dynamically!</a></li>
<li><a title="Extend your objects with DynamicObject to get a dynamic experience" href="http://blog.filipekberg.se/2011/10/02/extend-your-objects-with-dynamicobject-to-get-a-dynamic-experience/" target="_blank">Extend your objects with DynamicObject to get a dynamic experience</a></li>
<li><a title="Invoke a dynamic object as if it were a method" href="http://blog.filipekberg.se/2011/10/03/invoke-a-dynamic-object-as-if-it-where-a-method/" target="_blank">Invoke a dynamic object as if it were a method</a></li>
<li><a title="Using dynamic in the real world with IronPython" href="http://blog.filipekberg.se/2011/10/04/using-dynamic-in-the-real-world-with-ironpython/" target="_blank">Using dynamic in the real world with IronPython</a></li>
<li><a title="Playing with anonymous types in C#" href="http://blog.filipekberg.se/2011/10/06/playing-with-anonymous-types-in-c/" target="_blank">Playing with anonymous types in C#</a></li>
<li><a title="Exploring reflection – Finding a value in any of the objects properties" href="http://blog.filipekberg.se/2011/10/08/exploring-reflection-finding-a-value-in-any-of-the-objects-properties/" target="_blank">Exploring reflection – Finding a value in any of the objects properties</a></li>
<li><a title="What is reflection and why is it useful?" href="http://blog.filipekberg.se/2011/10/09/what-is-reflection-and-why-is-it-useful/" target="_blank">What is reflection and why is it useful?</a></li>
<li><a title="Using reflection to get information about attributes on your class and properties" href="http://blog.filipekberg.se/2011/10/09/using-reflection-to-get-information-about-attributes-on-your-class-and-properties/" target="_blank">Using reflection to get information about attributes on your class and properties</a></li>
<li><a title="Setting values by using reflection" href="http://blog.filipekberg.se/2011/10/10/setting-values-by-using-reflection/" target="_blank">Setting values by using reflection</a></li>
<li><a title="Creating static methods at runtime" href="http://blog.filipekberg.se/2011/10/11/creating-static-methods-at-runtime/" target="_blank">Creating static methods at runtime</a></li>
<li><a title="Getting information about a method and its local variables" href="http://blog.filipekberg.se/2011/10/12/getting-information-about-a-method-and-its-local-variables/" target="_blank">Getting information about a method and its local variables</a></li>
<li><a title="How Dynamic Methods affect resources like memory and disk space" href="http://blog.filipekberg.se/2011/10/13/how-dynamic-methods-affect-resources-like-memory-and-disk-space/" target="_blank">How Dynamic Methods affect resources like memory and disk space&gt;</a></li>
<li><a title="Calling a non-dynamic method with parameters from a dynamic method" href="http://blog.filipekberg.se/2011/10/14/calling-a-non-dynamic-method-with-parameters-from-a-dynamic-method/" target="_blank">Calling a non-dynamic method with parameters from a dynamic method</a></li>
<li><a title="Exploring OpCodes with DynamicMethod and looking at the evaluation stack" href="http://blog.filipekberg.se/2011/10/16/exploring-opcodes-with-dynamicmethod-and-looking-at-the-evaluation-stack/" target="_blank">Exploring OpCodes with DynamicMethod and looking at the evaluation stack</a></li>
<li><a title="Calling a dynamic method from a dynamic method" href="http://blog.filipekberg.se/2011/10/16/calling-a-dynamic-method-from-a-dynamic-method/" target="_blank">Calling a dynamic method from a dynamic method</a></li>
<li><a title="Creating a recursive dynamic method that calculates factorial" href="http://blog.filipekberg.se/2011/10/17/creating-a-recursive-dynamic-method-that-calculates-factorial/" target="_blank">Creating a recursive dynamic method that calculates factorial</a></li>
<li><a title="Creating a Dynamic Method that uses a Switch" href="http://blog.filipekberg.se/2011/10/18/creating-a-dynamic-method-that-uses-a-switch/" target="_blank">Creating a Dynamic Method that uses a Switch</a></li>
</ul>
<p><strong>Software Architecture</strong></p>
<ul>
<li><a title="Over-engineering trivial tasks can be challenging and educating" href="http://blog.filipekberg.se/2011/06/01/over-engineering-trivial-tasks-can-be-challanging-and-educating/" target="_blank">Over-engineering trivial tasks can be challenging and educating</a></li>
<li><a title="Making code more readable with anonymous functions" href="http://blog.filipekberg.se/2011/10/05/making-code-more-readable-with-anonymous-functions/" target="_blank">Making code more readable with anonymous functions</a></li>
<li><a title="Adapting to Inversion of Control and Dependency Injection" href="http://blog.filipekberg.se/2011/12/20/adapting-to-inversion-of-control-and-dependency-injection/" target="_blank">Adapting to Inversion of Control and Dependency Injection</a></li>
</ul>
<p><strong>Compiler as a Service</strong></p>
<ul>
<li><a title="Using Roslyn to parse C# code files" href="http://blog.filipekberg.se/2011/10/20/using-roslyn-to-parse-c-code-files/" target="_blank">Using Roslyn to parse C# code files</a></li>
<li><a title="Getting all methods from a code file with Roslyn" href="http://blog.filipekberg.se/2011/10/21/getting-all-methods-from-a-code-file-with-roslyn/" target="_blank">Getting all methods from a code file with Roslyn</a></li>
<li><a title="Creating a basic code analysis with Roslyn" href="http://blog.filipekberg.se/2011/10/23/creating-a-basic-code-analysis-with-roslyn/" target="_blank">Creating a basic code analysis with Roslyn</a></li>
<li><a title="Exploring how to write a code analyzer with Roslyn" href="http://blog.filipekberg.se/2011/10/23/exploring-how-to-write-a-code-analyzer-with-roslyn/" target="_blank">Exploring how to write a code analyzer with Roslyn</a></li>
<li><a title="Using the C# Interactive Window that comes with Roslyn" href="http://blog.filipekberg.se/2011/11/14/using-the-c-interactive-window-that-comes-with-roslyn/" target="_blank">Using the C# Interactive Window that comes with Roslyn</a></li>
<li><a title="Using the C# Interactive Window that comes with Roslyn – Part 2" href="http://blog.filipekberg.se/2011/11/25/using-the-c-interactive-window-that-comes-with-roslyn-part-2/" target="_blank">Using the C# Interactive Window that comes with Roslyn – Part 2</a></li>
<li><a title="Hosted Execution of smaller code snippets with Roslyn" href="http://blog.filipekberg.se/2011/12/08/hosted-execution-of-smaller-code-snippets-with-roslyn/" target="_blank">Hosted Execution of smaller code snippets with Roslyn</a></li>
</ul>
<p><strong>Screencasts</strong></p>
<ul>
<li><a title="C# 5 Async CTP – Async in Action – Video screencast" href="http://blog.filipekberg.se/2011/06/11/c-5-async-ctp-async-in-action-video-screencast/" target="_blank">C# 5 Async CTP – Async in Action – Video screencast</a></li>
<li><a title="C# 5 Async CTP – Old VS New – Video screencast" href="http://blog.filipekberg.se/2011/06/20/c-5-async-ctp-%E2%80%93-old-vs-new-%E2%80%93-video-screencast/" target="_blank">C# 5 Async CTP – Old VS New – Video screencast</a></li>
<li><a title="C# 4.0 Using the Dynamic Keyword" href="http://blog.filipekberg.se/2011/07/21/c-4-0-using-the-dynamic-keyword/" target="_blank">C# 4.0 Using the Dynamic Keyword</a></li>
<li><a title="Generic Programming in C#" href="http://blog.filipekberg.se/2011/07/25/generic-programming-in-c/" target="_blank">Generic Programming in C#</a></li>
</ul>
<p><strong>Other</strong></p>
<ul>
<li><a title="WPF vs WinForms – Which is easier to learn?" href="http://blog.filipekberg.se/2011/07/10/wpf-vs-winforms-which-is-easier-to-learn/" target="_blank">WPF vs WinForms – Which is easier to learn?</a></li>
<li><a title="Visual Studio 11 and Visual Studio 2010 Side by Side" href="http://blog.filipekberg.se/2011/09/19/visual-studio-11-and-visual-studio-2010-side-by-side/" target="_blank">Visual Studio 11 and Visual Studio 2010 Side by Side</a></li>
<li><a title="When can knowing about IL and the internals be useful?" href="http://blog.filipekberg.se/2011/10/19/when-can-knowing-about-il-and-the-internals-be-useful/" target="_blank">When can knowing about IL and the internals be useful?</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jiahu.net/a-summary-of-filip-ekbergs-blog-in-2011.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transaction for OracleConnection in .Net</title>
		<link>http://jiahu.net/transactionscope-for-oracle-in-net.htm</link>
		<comments>http://jiahu.net/transactionscope-for-oracle-in-net.htm#comments</comments>
		<pubDate>Thu, 03 Jun 2010 22:58:13 +0000</pubDate>
		<dc:creator>@ouc</dc:creator>
				<category><![CDATA[工作]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://jiahu.net/?p=1480</guid>
		<description><![CDATA[1. 单个数据库连接 可以直接使用OracleTransaction对象做事务处理 using(var transaction = connection.BeginTransaction()) { .....在这个作用域上的数据库操作，必须基于这个transaction using(var command = new OracleCommand(commandText, connection) { Transaction = transaction }) { ... } ... transaction.Commit(); //transaction.Rollback(); } 2. 多个数据库连接 可以使用TransactionScope对象来维护多个数据库连接中的事务处理 var options = new TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted, Timeout &#8230; <a href="http://jiahu.net/transactionscope-for-oracle-in-net.htm">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>1. 单个数据库连接</p>
<p>可以直接使用OracleTransaction对象做事务处理</p>
<pre lang="csharp">
using(var transaction = connection.BeginTransaction())
{
.....在这个作用域上的数据库操作，必须基于这个transaction
using(var command = new OracleCommand(commandText, connection) { Transaction = transaction })
{
...
}
...
transaction.Commit(); //transaction.Rollback();
}
</pre>
<p>2. 多个数据库连接</p>
<p>可以使用TransactionScope对象来维护多个数据库连接中的事务处理</p>
<pre lang="csharp">
var options = new TransactionOptions { IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted, Timeout = new TimeSpan(0, 2, 0) };

using (var transaction = new TransactionScope(TransactionScopeOption.Required, options))
{
.....在这个作用域里面的数据库操作，不需要传递transaction对象
using(var connection1 = new OracleConnection(connectionString1))
{
...
}

using(var connection2 = new OracleConnection(connectionString2))
{
...
}

transaction.Complete();
}
</pre>
<p>注1: 使用TransactionScope对象前，需要添加引用System.Transaction</p>
<p>注2: 对于多个Oracle连接来说，使用TransactionScope对象前，需要安装Oracle Services For MTS (Microsoft Transaction Server)。下载地址：<a href="http://goo.gl/XrKn" target="_blank">http://goo.gl/XrKn</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jiahu.net/transactionscope-for-oracle-in-net.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在Repeater中添加换页符</title>
		<link>http://jiahu.net/%e5%9c%a8repeater%e4%b8%ad%e6%b7%bb%e5%8a%a0%e6%8d%a2%e9%a1%b5%e7%ac%a6.htm</link>
		<comments>http://jiahu.net/%e5%9c%a8repeater%e4%b8%ad%e6%b7%bb%e5%8a%a0%e6%8d%a2%e9%a1%b5%e7%ac%a6.htm#comments</comments>
		<pubDate>Fri, 04 Sep 2009 09:42:17 +0000</pubDate>
		<dc:creator>@ouc</dc:creator>
				<category><![CDATA[技术]]></category>
		<category><![CDATA[资源]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[打印]]></category>

		<guid isPermaLink="false">http://jiahu.net/?p=1154</guid>
		<description><![CDATA[1234567protected void ItemDataBound(object sender, RepeaterItemEventArgs e) { if ((e.Item.ItemType.Equals(ListItemType.Item) &#124;&#124; e.Item.ItemType.Equals(ListItemType.AlternatingItem)) &#38;amp;&#38;amp; (e.Item.ItemIndex + 1) % ProductsPerPage == 0) { e.Item.Controls.Add(new LiteralControl(&#34;&#38;lt;tr&#38;gt;&#38;lt;td class=\&#34;PageBreak\&#34; &#38;gt;&#38;lt;/td&#38;gt;&#38;lt;/tr&#38;gt;&#34;)); } } 来源: http://weblogs.asp.net/dennisthemenace/archive/2008/01/25/insertion-of-a-page-break-in-a-repeater.aspx]]></description>
			<content:encoded><![CDATA[<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">protected void ItemDataBound(object sender, RepeaterItemEventArgs e)<br />
{<br />
if ((e.Item.ItemType.Equals(ListItemType.Item) || e.Item.ItemType.Equals(ListItemType.AlternatingItem)) &amp;amp;&amp;amp; (e.Item.ItemIndex + 1) % ProductsPerPage == 0)<br />
{<br />
e.Item.Controls.Add(new LiteralControl(&quot;&amp;lt;tr&amp;gt;&amp;lt;td class=\&quot;PageBreak\&quot; &amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&quot;));<br />
}<br />
}</div></td></tr></tbody></table></div>
<p>来源: <a href="http://weblogs.asp.net/dennisthemenace/archive/2008/01/25/insertion-of-a-page-break-in-a-repeater.aspx" target="_blank">http://weblogs.asp.net/dennisthemenace/archive/2008/01/25/insertion-of-a-page-break-in-a-repeater.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jiahu.net/%e5%9c%a8repeater%e4%b8%ad%e6%b7%bb%e5%8a%a0%e6%8d%a2%e9%a1%b5%e7%ac%a6.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert integer to Enum instance</title>
		<link>http://jiahu.net/convert-integer-to-enum-instance.htm</link>
		<comments>http://jiahu.net/convert-integer-to-enum-instance.htm#comments</comments>
		<pubDate>Mon, 27 Oct 2008 04:19:03 +0000</pubDate>
		<dc:creator>@ouc</dc:creator>
				<category><![CDATA[工作]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[代码]]></category>

		<guid isPermaLink="false">http://cngator.net/?p=774</guid>
		<description><![CDATA[public void EnumInstanceFromInt() { // The .NET Framework contains an Enum called DayOfWeek. // Let&#8217;s generate some Enum instances from int values. // Usually you wouldn&#8217;t cast an instance of an existing Enum to an int // in order to &#8230; <a href="http://jiahu.net/convert-integer-to-enum-instance.htm">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>public void EnumInstanceFromInt()<br />
{<br />
// The .NET Framework contains an Enum called DayOfWeek.<br />
// Let&#8217;s generate some Enum instances from int values.</p>
<p>// Usually you wouldn&#8217;t cast an instance of an existing Enum to an int<br />
// in order to create an Enum instance.  :-)  You would have the actual<br />
// integer value, perhaps a value from a database where the int value of<br />
// the enum was stored.</p>
<p>DayOfWeek wednesday =<br />
(DayOfWeek)Enum.ToObject(typeof(DayOfWeek), (int)DayOfWeek.Wednesday);<br />
DayOfWeek sunday =<br />
(DayOfWeek)Enum.ToObject(typeof(DayOfWeek), (int)DayOfWeek.Sunday);<br />
DayOfWeek tgif =<br />
(DayOfWeek)Enum.ToObject(typeof(DayOfWeek), (int)DayOfWeek.Friday);</p>
<p>lblOutput.Text = wednesday.ToString()<br />
+ “.  Int value = ” + ((int)wednesday).ToString() + “\n”;<br />
lblOutput.Text += sunday.ToString()<br />
+ “.  Int value = ” + ((int)sunday).ToString() + “\n”;<br />
lblOutput.Text += tgif.ToString()<br />
+ “.  Int value = ” + ((int)tgif).ToString() + “\n”;<br />
}</p>
<p>Result:</p>
<p>Wednesday. Int value = 3<br />
Sunday. Int value = 0<br />
Friday. Int value = 5</p>
<p>Link: <a href="http://www.cambiaresearch.com/c4/52a7e5fe-c7fc-49ab-b21d-37e6194687f3/Convert-Integer-To-Enum-Instance-in-csharp.aspx" target="_blank">http://www.cambiaresearch.com/c4/52a7e5fe-c7fc-49ab-b21d-37e6194687f3/Convert-Integer-To-Enum-Instance-in-csharp.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jiahu.net/convert-integer-to-enum-instance.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

