﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>博客园-代码乱了(靳如坦的技术blog)</title><link>http://www.cnblogs.com/jintan/</link><description>专注于.net,c#,Ajax、Sql Server、SmartClient等相关的开发</description><language>zh-cn</language><lastBuildDate>Thu, 28 Aug 2008 03:24:34 GMT</lastBuildDate><pubDate>Thu, 28 Aug 2008 03:24:34 GMT</pubDate><ttl>60</ttl><item><title>My interested stuff(2008-08-27)</title><link>http://www.cnblogs.com/jintan/archive/2008/08/27/1277279.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Wed, 27 Aug 2008 00:53:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/08/27/1277279.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1277279.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/08/27/1277279.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1277279.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1277279.html</trackback:ping><description><![CDATA[<p>Web &amp; Controls</p> <ul> <li><a title="Custom Alert Boxes using JavaScript and the DOM" href="http://www.codeproject.com/KB/scripting/DOMAlert.aspx">Custom Alert Boxes using JavaScript and the DOM</a></li> <li><a title="A Custom Dialog Box Control" href="http://www.codeproject.com/KB/custom-controls/customdialog.aspx">A Custom Dialog Box Control</a></li> <li><a href="http://www.codeproject.com/KB/cs/ScriptBuilder.aspx">A Library for Writing/Building Scripts in C#</a></li> <li><a href="http://www.codeproject.com/KB/server-management/IIs6Manager.aspx">IIsManager</a></li></ul> <p>&nbsp;</p> <p>DataBase</p> <ul> <li><a href="http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx" target="_blank">Database Helper v 2.0.0</a></li></ul> <img src ="http://www.cnblogs.com/jintan/aggbug/1277279.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41931/" target="_blank">[新闻]GC2008：星际争霸2进程报告 微调进程延续</a>]]></description></item><item><title>Set Focus to Control </title><link>http://www.cnblogs.com/jintan/archive/2008/08/22/1273723.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Fri, 22 Aug 2008 01:14:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/08/22/1273723.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1273723.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/08/22/1273723.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1273723.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1273723.html</trackback:ping><description><![CDATA[I was trying to set focus using the code <br />
<br />
this.ScriptManager1.SetFocus(myControlName.ClientID); <br />
<br />
and I wrote this code in my SelectedIndexChanged Event Function. That time this code didn't work. <br />
<br />
Now I changed this code to Page Load Function i.e. <br />
<div class="cnblogs_code"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000ff">protected</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;Page_Load(</span><span style="color: #0000ff">object</span><span style="color: #000000">&nbsp;sender,&nbsp;EventArgs&nbsp;e)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(</span><span style="color: #000000">!</span><span style="color: #000000">IsPostBack)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">this</span><span style="color: #000000">.ScriptManager1.SetFocus(myControlName.ClientID);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">this</span><span style="color: #000000">.ScriptManager1.SetFocus(GetPostBackControl(</span><span style="color: #0000ff">this</span><span style="color: #000000">.Page).ClientID);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}&nbsp;<br />
</span></div>
<br />
<br />
Here I am using a function GetPostBackControl() to identify the current postbacking control and I am setting focus to the same control. If you want to move focus to any other control, just use a Switch Statment. <br />
<div class="cnblogs_code"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000ff">public</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">static</span><span style="color: #000000">&nbsp;System.Web.UI.Control&nbsp;GetPostBackControl(System.Web.UI.Page&nbsp;page)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;Control&nbsp;control&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;ctrlname&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;page.Request.Params[</span><span style="color: #800000">"</span><span style="color: #800000">__EVENTTARGET</span><span style="color: #800000">"</span><span style="color: #000000">];<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(ctrlname&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">&amp;&amp;</span><span style="color: #000000">&nbsp;ctrlname&nbsp;</span><span style="color: #000000">!=</span><span style="color: #000000">&nbsp;String.Empty)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;control&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;page.FindControl(ctrlname);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">&nbsp;if&nbsp;__EVENTTARGET&nbsp;is&nbsp;null,&nbsp;the&nbsp;control&nbsp;is&nbsp;a&nbsp;button&nbsp;type&nbsp;and&nbsp;we&nbsp;need&nbsp;to&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">&nbsp;iterate&nbsp;over&nbsp;the&nbsp;form&nbsp;collection&nbsp;to&nbsp;find&nbsp;it&nbsp;</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;ctrlStr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;String.Empty;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Control&nbsp;c&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">null</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">foreach</span><span style="color: #000000">&nbsp;(</span><span style="color: #0000ff">string</span><span style="color: #000000">&nbsp;ctl&nbsp;</span><span style="color: #0000ff">in</span><span style="color: #000000">&nbsp;page.Request.Form)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000">//</span><span style="color: #008000">&nbsp;handle&nbsp;ImageButton&nbsp;controls&nbsp;<img src="http://www.cnblogs.com/Images/dot.gif"  alt="" />&nbsp;</span><span style="color: #008000"><br />
</span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(ctl.EndsWith(</span><span style="color: #800000">"</span><span style="color: #800000">.x</span><span style="color: #800000">"</span><span style="color: #000000">)&nbsp;</span><span style="color: #000000">||</span><span style="color: #000000">&nbsp;ctl.EndsWith(</span><span style="color: #800000">"</span><span style="color: #800000">.y</span><span style="color: #800000">"</span><span style="color: #000000">))<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ctrlStr&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;ctl.Substring(</span><span style="color: #800080">0</span><span style="color: #000000">,&nbsp;ctl.Length&nbsp;</span><span style="color: #000000">-</span><span style="color: #000000">&nbsp;</span><span style="color: #800080">2</span><span style="color: #000000">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;page.FindControl(ctrlStr);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">else</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;page.FindControl(ctl);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">if</span><span style="color: #000000">&nbsp;(c&nbsp;</span><span style="color: #0000ff">is</span><span style="color: #000000">&nbsp;System.Web.UI.WebControls.Button&nbsp;</span><span style="color: #000000">||</span><span style="color: #000000"><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c&nbsp;</span><span style="color: #0000ff">is</span><span style="color: #000000">&nbsp;System.Web.UI.WebControls.ImageButton)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;control&nbsp;</span><span style="color: #000000">=</span><span style="color: #000000">&nbsp;c;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">break</span><span style="color: #000000">;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;control;<br />
}<br />
</span></div>
<br />
<img src ="http://www.cnblogs.com/jintan/aggbug/1273723.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41930/" target="_blank">[新闻]科学家在世界最大对撞机中观察到首批粒子</a>]]></description></item><item><title>My interested stuff(2008-08-21)</title><link>http://www.cnblogs.com/jintan/archive/2008/08/21/1273530.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Thu, 21 Aug 2008 13:35:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/08/21/1273530.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1273530.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/08/21/1273530.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1273530.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1273530.html</trackback:ping><description><![CDATA[<p>Web</p>
<ul>
    <li><a href="http://www.webappers.com/">http://www.webappers.com/</a>&nbsp; -&nbsp; 一个很好的web资源网站，搜集了大量的学习资料和漂亮的例子，如图标，button,window等组件</li>
    <li><a title="Permanent Link to Multibox Supports Images, Flash, Video, MP3 and HTML" href="http://www.webappers.com/2008/01/18/multibox-supports-images-flash-video-mp3-and-html/" rel="bookmark">Multibox Supports Images, Flash, Video, MP3 and HTML</a>&nbsp; -&nbsp; 一个图片，flash等展示的Multibox，非常漂亮</li>
    <li><a href="http://www.iconshock.com/">http://www.iconshock.com/</a>&nbsp;- 图标库，图标很多也很全，可惜都要$ <img alt="" src="http://www.cnblogs.com/Emoticons/msn/48_48.gif" /></li>
    <li><a href="http://crazeegeekchick.com/blog/10-invaluable-css-resources/" target="_blank">10 Invaluable CSS Resources </a><a href="http://nayyeri.net/blog/building-a-custom-xml-configuration-system-for-asp.net-ndash-part-1/"></li>
    <li>Building a Custom XML Configuration System for ASP.NET &#8211; Part 1&nbsp;</a>&nbsp;</li>
    <li><a id="viewpost_ascx_TitleUrl" title="Title of this entry." href="http://ryanfarley.com/blog/archive/2004/12/21/1325.aspx">Set Focus to an ASP.NET Control</a>&nbsp; </li>
</ul>
<p>Viual Studio</p>
<ul>
    <li><a href="http://blogs.msdn.com/saraford/archive/2008/08/21/did-you-know-you-can-debug-an-executable-that-isn-t-a-part-of-a-visual-studio-project-without-using-tools-attach-to-process-296.aspx" target="_blank">Did you know&#8230; You can debug an executable that isn&#8217;t a part of a Visual Studio project without using Tools &#8211; Attach to Process? - #296 </a>- 调试可执行文件不用&#8220;附加到进程&#8221;，可以直接从该可执行文件从启动开始调试（例如调试服务）</li>
    <li><a href="http://www.hanselman.com/smallestdotnet/">Get the .NET Framework Fast</a> - Scott Hanselman has created a simple single page site which, via browser testing, attempts to offer the user the smallest download possible to obtain the .NET Framework</li>
    <li><a href="http://samgentile.com/blogs/samgentile/archive/2008/08/13/screencast-creating-your-first-wcf-service.aspx" target="_blank">Screencast - Creating your First WCF Service</a> </li>
</ul>
<p>Link bolg</p>
<ul>
    <li><a href="http://nayyeri.net/blog/my-favorite-.net-link-blogs/" target="_blank">My Favorite .NET Link Blogs</a> </li>
</ul>
<p>Other</p>
<ul>
    <li><a id="viewpost_ascx_TitleUrl" title="Title of this entry." href="http://ryanfarley.com/blog/archive/2004/05/14/629.aspx">In Search of the Perfect RSS Reader</a>&nbsp; </li>
</ul>
<p>P2P</p>
<ul>
    <li><a href="http://www.codeplex.com/SharpStunt/SourceControl/ListDownloadableCommits.aspx">SharpSTUNT</a>&nbsp;at&nbsp;Codeplex&nbsp; 一个不错的p2p库，能穿透NAT,文档：&nbsp; <a href="http://www.watersprings.org/pub/id/draft-takeda-symmetric-nat-traversal-00.txt">Symmetric NAT Traversal using STUN</a>&nbsp;and <a href="http://en.wikipedia.org/wiki/STUN">http://en.wikipedia.org/wiki/STUN</a></li>
    <li><span class="ArticleTopTitle" id="ctl00_ArticleTopHeader_ArticleTitle"><a href="http://www.codeproject.com/KB/IP/upnpnattraversal.aspx" target="_blank"><span class="ArticleTopTitle" id="ctl00_ArticleTopHeader_ArticleTitle">Generic P2P Architecture, Tutorial and Example</span></a></span></li>
    <li><span class="ArticleTopTitle"><a href="http://www.codeproject.com/KB/IP/upnpnattraversal.aspx" target="_blank"><span class="ArticleTopTitle" id="ctl00_ArticleTopHeader_ArticleTitle">NAT Traversal with UPnP in C#</span></a></span></li>
    <li><a href="http://www.codeplex.com/sMessenger/SourceControl/ListDownloadableCommits.aspx">sMessenger</a>&nbsp;at&nbsp;Codeplex&nbsp; 应该不是真正的p2p聊天程序，未测试 </li>
</ul>
<img src ="http://www.cnblogs.com/jintan/aggbug/1273530.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41929/" target="_blank">[新闻]阿里巴巴利润增1.36倍</a>]]></description><enclosure url="Web,图标,XML,VS,P2P" type="audio/mpeg" /></item><item><title>My interested stuff(2008-08-03)</title><link>http://www.cnblogs.com/jintan/archive/2008/08/02/1258542.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Fri, 01 Aug 2008 17:12:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/08/02/1258542.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1258542.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/08/02/1258542.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1258542.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1258542.html</trackback:ping><description><![CDATA[<p>SQL</p>
<ul>
    <li><a href="http://www.simple-talk.com/sql/t-sql-programming/concatenating-row-values-in-transact-sql/">Concatenating Row Values in Transact-SQL</a></li>
    <li><a id="viewpost_ascx_TitleUrl" title="Title of this entry." href="http://weblogs.sqlteam.com/tarad/archive/2008/08/19/Backup-SQL-Server-Databases.aspx">Backup SQL Server Databases</a>&nbsp; - cool looking stored procedure that will back up a database for you ... I'll have to check it out to see if it is better or would work better than my current cmd files using sqlcmd. </li>
</ul>
<p>&nbsp;Excel</p>
<ul>
    <li><a href="http://www.simple-talk.com/dotnet/.net-tools/creating-excel-and-word-reports-for-.net-applications-using-officewriter/" target="_blank">Creating Excel and Word reports for .NET applications using OfficeWriter</a> </li>
</ul>
<p>Add-in</p>
<ul>
    <li><a href="http://wildermuth.com/2008/07/31/RockScroll_FTW">RockScroll FTW</a>(非常酷，代替原来的代码滚动条)</li>
    <li>
    <h1 class="ProjectHeader NoMargin" style="font-size: 8pt"><a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/Xsd2Code"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6">CSharp or Visual Basic class generator from XSD</font></span></a>&nbsp;</h1>
    </li>
    <li>
    <h1 class="ProjectHeader NoMargin" style="font-size: 8pt"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6"><span style="color: #003300"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6"><a href="http://www.cnblogs.com/jintan/admin/DB%20Connection%20Visualizer">DB Connection Visualizer </a><a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/ExportAsCodeSnippet"></a></h1>
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt"></font></span></span></font></span><img alt="screenshot.jpg" src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=dbvisualizer&amp;DownloadId=3114" />&nbsp;&nbsp;&nbsp;&nbsp; </h1>
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt">&nbsp;</h1>
    </li>
</ul>
<ul>
    <li>
    <h1 class="ProjectHeader NoMargin" style="font-size: 8pt">
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6"><span style="font-size: 10pt"><a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/ShortcutsAddin"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6">Visual Studio 2003/2005/2008 Shortcuts Addin</font></span></a><a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/ShortcutsAddin"> </span></font></span></a>（不错的插件，添加常用文件的快捷方式）</h1>
    </h1>
    <h1 class="ProjectHeader NoMargin" style="font-size: 8pt">
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt"></li>
    <li>
    <h1 class="ProjectHeader NoMargin" style="font-size: 8pt">&nbsp;<span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6"><span style="font-size: 10pt"><a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/SSMSAllocation"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6">Allocation SQL Server Management Studio Add-in</font></span></a><a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/SSMSAllocation"> </span></font></span></a></h1>
    </li>
    <li>
    <h1 class="ProjectHeader NoMargin" style="font-size: 8pt">
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6">&nbsp; <a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/ExportAsCodeSnippet"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6">Export code as Code Snippet - Addin for Visual Studio 2008</font></a><a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/ExportAsCodeSnippet"> </a><a class="NoUnderline" id="ctl00_ctl00_WideContent_ProjectTitleControl1_ProjectTitleLink" href="http://www.codeplex.com/ExportAsCodeSnippet"><span id="ctl00_ctl00_WideContent_ProjectTitleControl1_TitleLabel"><font color="#3e62a6"></font></span></a></span></font></span></h1>
    </h1>
    </h1>
    </h1>
    </li>
    <li>
    <h1 class="ProjectHeader NoMargin" style="font-size: 8pt">
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt"><a href="http://www.codeplex.com/NQuery">
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt"><span style="color: #800000"><span style="color: #800000">&nbsp; NQuery!&nbsp; （一个可以用SQL语句查询任何.net对象包括&nbsp;arrays, data sets, data tables ）</span></span></a>&nbsp;</h1>
    </h1>
    </h1>
    </li>
    <li>
    <h1 class="ProjectHeader NoMargin" style="font-size: 8pt">
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt">
    <h1 class="ProjectHeader NoMargin" style="font-size: 10pt"><img alt="Welcome.png" src="http://www.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=NQuery&amp;DownloadId=21278" /></h1>
    </h1>
    </h1>
    </li>
</ul>
<p>Web</p>
<ul>
    <li><a href="http://www.smashingmagazine.com/2008/07/24/a-small-study-of-big-blogs/">A Small Design Study Of Big Blogs</a></li>
    <li><a title="Links of Interest" href="http://css-tricks.com/links-of-interest-41/">Links of Interest</a></li>
    <li><a href="http://nayyeri.net/blog/how-to-encrypt-query-string-parameters-in-asp.net/">How to Encrypt Query String Parameters in ASP.NET</a></li>
    <li><a href="http://www.noupe.com/css/using-css-to-do-anything-50-creative-examples-and-tutorials.html">50个CSS创意例子。</a></li>
    <li><a href="http://cssround.com/">CSS圆角生成。</a></li>
    <li><a href="http://www.smashingmagazine.com/2008/08/11/5-useful-coding-solutions-for-designers-and-developers/"></a><a title="Permanent Link: How to easily enhance your existing tables with simple CSS" href="http://encosia.com/2008/08/13/how-to-easily-enhance-your-existing-tables-with-simple-css/" rel="bookmark">How to easily enhance your existing tables with simple CSS</a><a href="http://www.smashingmagazine.com/2008/08/11/5-useful-coding-solutions-for-designers-and-developers/"></li>
    <li>5 Useful Coding Solutions For Designers and Developers </a>&nbsp;</li>
    <li><a href="http://dryicons.com/free-icons/preview/coquette-icons-set/">Coquette</a> - 一个非常不错的图标网站</li>
</ul>
<p>Other</p>
<ul>
    <li><a href="http://www.codeproject.com/KB/grid/ReportExporters_WinForms.aspx">Exporting DataGridView to Excel/Pdf/Image file by using Reporting Services report generation</a></li>
    <li><a href="http://weblogs.asp.net/okloeten/archive/2008/08/01/6463327.aspx">Extension Methods Roundup: Intersect, Union, AsNullable and GroupEvery</a></li>
    <li><a href="http://www.codeproject.com/KB/recipes/TinyPG.aspx">a Tiny Parser Generator</a></li>
    <li><a href="http://www.techtoolblog.com/archives/must-have-software-and-tools">Must Have Software and Tools</a></li>
    <li>Via <a href="http://www.alvinashcraft.com/2008/07/24/dew-drop-july-24-2008/">Alvin Ashcraft</a>:&nbsp; Phil Denoncourt has written a <a href="http://blog.philknows.net/PermaLink,guid,cc1eee3d-00b2-449d-a466-f652d7cb1f3b.aspx">Visual Studio Add-in that integrates speech recognition with the Visual Studio environment</a>.&nbsp; He posted the installer and source on CodePlex.</li>
    <li><a title='Permanent Link to "My Top 10 Source Code Search Engines"' href="http://www.cavdar.net/2008/08/01/my-top-10-source-code-search-engines/" rel="bookmark">My Top 10 Source Code Search Engines</a></li>
    <li><a href="http://www.simple-talk.com/dotnet/.net-framework/dynamically-generating--typed-objects-in-.net/" target="_blank">Dynamically generating typed objects in .NET</a> </li>
</ul>
<h4>&nbsp;</h4>
<h4>How do I detect a session has expired and redirect it to another page</h4>
<p><strong>override protected void OnInit(EventArgs e)<br />
&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; base.OnInit(e);<br />
if (Context.Session != null)<br />
&nbsp;&nbsp; {&nbsp;&nbsp;&nbsp; if (Session.IsNewSession)<br />
&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp; string szCookieHeader = Request.Headers["Cookie"];<br />
&nbsp;&nbsp;&nbsp;&nbsp; if ((null != szCookieHeader) &amp;&amp; (szCookieHeader.IndexOf("ASP.NET_SessionId") &gt;= 0))<br />
&nbsp;&nbsp;&nbsp;&nbsp; {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.Redirect("sessionTimeout.htm");<br />
&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp; <br />
&nbsp;&nbsp;&nbsp; } <br />
&nbsp;&nbsp; }<br />
&nbsp; }</strong></p>
<img src ="http://www.cnblogs.com/jintan/aggbug/1258542.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41928/" target="_blank">[新闻]Google Gears覆盖四大浏览器 Safari版推出</a>]]></description></item><item><title>动态创建rdlc报表，绑定任意Dataset</title><link>http://www.cnblogs.com/jintan/archive/2008/07/29/1255935.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Tue, 29 Jul 2008 14:03:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/07/29/1255935.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1255935.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/07/29/1255935.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1255935.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1255935.html</trackback:ping><description><![CDATA[<p>&nbsp;&nbsp;&nbsp; 需求是这样的：我有一个DataSet,其中有一个DataTable,这个DataTable是根据调用存储过程不同的参数而生成的数据集，其列是可变的。现在需要为这样的数据集做一个简单的报表。</p>
<p>&nbsp;&nbsp;&nbsp; 你不可能为一个可变列的DataTable设计一个固定的rdlc报表文件，因为column是动态的，可能是2列，可能是3列，可能是10列，列名也不同，</p>
<p>目前的办法也只能是根据DataSet,动态创建rdlc,然后再绑定到ReportViewer上。不知道还有其他更方便的方法。</p>
<p>&nbsp;</p>
<p>下面两篇文章介绍了动态创建rdlc报表，绑定任意Dataset的方式，并结合xslt控制显示的样式外观，感觉还是很不错的</p>
<p>第二个链接是修正版本。</p>
<p><a href="http://csharpshooter.blogspot.com/2007/08/generate-rdlc-dynamically-for-vs-2005.html">Generate a RDLC dynamically for the VS 2005 Report Viewer Control</a> </p>
<p><a href="http://csharpshooter.blogspot.com/2007/08/revised-dynamic-rdlc-generation.html">Revised Dynamic RDLC Generation</a> </p>
<p>&nbsp;</p>
<p>我自己做了一个demo试了一下</p>
<p>效果还是不错的</p>
<p>&nbsp;</p>
<img src ="http://www.cnblogs.com/jintan/aggbug/1255935.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41927/" target="_blank">[新闻]Internet Explorer 8 Beta 2 发布</a>]]></description></item><item><title>Looking for icons?</title><link>http://www.cnblogs.com/jintan/archive/2008/07/28/1255076.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Mon, 28 Jul 2008 13:21:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/07/28/1255076.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1255076.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/07/28/1255076.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1255076.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1255076.html</trackback:ping><description><![CDATA[<h2 class="pageTitle">Looking for icons?</h2>
<p>It happens to all of us. You need an icon&nbsp;for a specific subject&nbsp;and you can't seem to find one. Having&nbsp;a new icon designed might take&nbsp;too long. </p>
<p>Usually,&nbsp;people simply resort to starting <a class="null" title="Search for images using Google" href="http://images.google.com/imghp?hl=en&amp;tab=wi" target="_blank">Google&nbsp;Image search</a>.&nbsp;This morning I bumped into <a class="null" title="Go to Wikimedia Commons" href="http://commons.wikimedia.org/wiki/Main_Page" target="_blank">Wikimedia Commons</a>. They have a large image base which is categorized into logical subjects. I found a number of very good icons for my current project here at <a class="null" title="Icons by subject" href="http://commons.wikimedia.org/wiki/Category:Icons_by_subject" target="_blank">this link</a>. </p>
<p>Here are some sample icons:</p>
<img src ="http://www.cnblogs.com/jintan/aggbug/1255076.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41924/" target="_blank">[新闻]中国软件协会：SAP羞辱国产软件是不正当竞争</a>]]></description></item><item><title>My interested stuff(2008-07-18)</title><link>http://www.cnblogs.com/jintan/archive/2008/07/18/1246432.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Fri, 18 Jul 2008 15:26:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/07/18/1246432.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1246432.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/07/18/1246432.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1246432.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1246432.html</trackback:ping><description><![CDATA[<p>DataBase:</p>
<ul>
    <li>sqlteam - <a title="Immediate deadlock notifications without changing existing code" href="http://weblogs.sqlteam.com/mladenp/archive/2008/07/18/Immediate-deadlock-notifications-without-changing-existing-code.aspx">Immediate deadlock notifications without changing existing code</a>(SQL死锁通知)</li>
    <li>sqlteam - <a href="http://www.sqlteam.com/article/integrating-profiler-and-perfmon-log-files">Integrating Profiler and PerfMon Log Files</a>(SQL跟踪监视的两种方式集成)</li>
    <li><a title="load tests from a SQL Server SQL Trace" href="http://coolthingoftheday.blogspot.com/2008/07/sql-load-test-generate-visual-studio.html">SQL Load Test &#8211; Generate Visual Studio unit/load tests from a SQL Server SQL Trace</a></li>
    <li>simple-talk - <a href="http://www.simple-talk.com/sql/database-administration/dml-trigger-status-alerts/">DML Trigger Status Alerts</a>(实时警告提示：DML触发器状态变化)</li>
    <li>simple-talk - <a href="http://www.simple-talk.com/sql/learn-sql-server/how-to-track-down-deadlocks-using-sql-server-2005-profiler/">How to Track Down Deadlocks Using SQL Server 2005 Profiler</a>（如何使用SQL Profiler跟踪死锁）&nbsp; </li>
</ul>
<p><strong>Tools</strong></p>
<ul>
    <li>代码转换：
    <ul>
        <li><a href="http://converter.telerik.com/"><strong>Telerik Code Converter</strong></a> - Website that converts C# to VB and VB to C#.</li>
        <li><a href="http://www.carlosag.net/Tools/CodeTranslator/"><strong>CarlosAg's CodeTranslator</strong></a> - One of the first, and many say, the best. An AJAXy Code Converter that'll do to and from C# and VB.NET. </li>
    </ul>
    </li>
    <li>正则表达式：
    <ul>
        <li><a href="http://www.funduc.com/search_replace.htm"><strong>Funduc's Search and Replace</strong></a> - 多文件搜索和替换，你会喜欢它的
        <ul>
            <li><img height="395" alt="Search and Replace Screen Shot" src="http://www.funduc.com/images/srshot.gif" width="381" border="0" /> </li>
        </ul>
        </li>
        <li><a href="http://regex.osherove.com/"><strong>Roy Osherove's Regulator</strong></a> - Roy entered the RegEx fray with a bang, and with syntax highlighting and web services integration with regexlib.com. The very definition of slick.
        <ul>
            <li><a href="http://tools.osherove.com/Default.aspx?tabid=187"><strong>RegEx Visualizers for VS 2005</strong></a> - Roy has extended his toolkit to include Debug Visualizers for Regular Expressions, based on his Regulator code base. （VS2005可视化调试插件，包括正则表达式代码作色，语法高亮显示）</li>
            <li><a href="http://tools.osherove.com/Default.aspx?tabid=182"><strong>Regulazy</strong></a> - Currently at version 1.01, this tool is a great way for newbies to start using Regular Expressions. Write regular expressions without prior knowledge of the syntax!<br />
            <em>"So you've got a problem, and you want to use Regular Expressions to solve it. Now you've got two problems."</em> </li>
        </ul>
        </li>
    </ul>
    </li>
    <li><a href="http://tools.osherove.com/">Cool Tool</a></li>
    <li><a href="http://colibri.leetspeak.org/"><strong>Colibri</strong></a> - The closest thing so far, IMHO, to <a href="http://quicksilver.blacktree.com/">Quicksilver</a> on Windows, although this little gem has a slow startup time, it runs <em>fast</em>! It's being actively developed and promises integration with a dozen third party programs. It also formally supports "Portable Mode" for those of you who like to carry your apps around on a USB key.</li>
    <li><a href="http://www.smallsharptools.com/Default.aspx">SmallSharpTools.com</a>&nbsp;
    <ul>
        <li>and <a href="http://www.visualstudiogallery.com/ExtensionDetails.aspx?ExtensionID=c57d512b-7601-4fc7-80b7-e34ec0c5bce4">JavaScript Browser</a> | <strong>Created by: </strong><a href="http://www.visualstudiogallery.com/Results.aspx?UserId=17f81a3a-3a3b-4b45-b10b-5398451ef527">SmallSharpTools</a> host on <a title="http://code.google.com/p/javascriptbrowser/" href="http://code.google.com/p/javascriptbrowser/">http://code.google.com/p/javascriptbrowser/</a> </li>
    </ul>
    </li>
    <li><a href="http://msdn.microsoft.com/zh-cn/magazine/cc300778(en-us).aspx" target="_blank">Visual Studio Add-Ins Every Developer Should Download Now</a></li>
</ul>
<p>Web</p>
<ul>
    <li><a href="http://www.paraesthesia.com/archive/2007/07/13/embeddedresourcepathprovider---binary-only-asp.net-2.0.aspx">EmbeddedResourcePathProvider - Binary-Only ASP.NET 2.0</a></li>
    <li><a href="http://mindstudies.psy.soton.ac.uk/dmitri/blog/index.php/archives/167">Array-Level Thinking</a>&nbsp;&nbsp;&nbsp; <a href="http://dotnet.dzone.com/news/aspnet-query-strings-client-si">ASP.NET - Query Strings - Client Side State Management</a>(代码着色不错，可以在博客中使用)</li>
    <li>&nbsp;<a title="Garage Door Style Menu (using Animated Background Images with jQuery)" href="http://css-tricks.com/garage-door-style-menu-using-animated-background-images-with-jquery/">Garage Door Style Menu (using Animated Background Images with jQuery)</a>(很绚)</li>
</ul>
<p>&nbsp;</p>
<p>Add-ins</p>
<ul>
    <li><a href="http://geekswithblogs.net/sdorman/archive/2007/08/15/The-Code-Project-Browser-Add-in-for-Visual-Studio.aspx"><strong>CodeProject Browser Add-In</strong></a> - A very cool idea. This Add-In integrates CodeProject with Visual Studio and keeps all your samples neatly organized. It'll download and upzip them also, and maintains a list of favorite CodeProject articles. This is a great way to build the <a href="http://www.codeproject.com/">CodeProject</a> community and folks should now about it.</li>
    <li><a href="http://www.smartassembly.com/"><strong>SmartAssembly</strong></a> - Code pruning, obfuscations, and automatic exception reporting. A great way to take your .NET application to the next level.</li>
    <li><a href="http://blog.bretts.net/?p=11"><strong>Cache Visualizer</strong></a> - What's in the ASP.NET cache? Find out with this VS2005 Visualizer.</li>
    <li><a title="Regionerate" href="http://www.rauchy.net/regionerate">Regionerate</a> - An automatic layout enforcement tool for the C# programming language.</li>
    <li>Chris Pietschmann - <a href="http://pietschsoft.com/post.aspx?id=991001f5-399b-42ff-829c-2b80cb49a8b8">dotNetExt - .NET Extension Method Library - v0.1 Beta Released</a> (扩展方法库)</li>
    <li><a href="http://www.developguidance.com/RADvolution_Demos.htm">RADvolution Designer - powerful RAD tool - VS2008</a> 非常强悍</li>
    <li><a title="C# Snippets for Visual Studio 2008 - Release v1.0" href="http://www.codeplex.com/csn/Release/ProjectReleases.aspx?ReleaseId=15498">C# Snippets for Visual Studio 2008 - Release v1.0</a>(CodePlex)</li>
    <li><a title="T4 Templates in Visual Studio for Code Generation Screencast" href="http://www.pnpguidance.net/post/T4TemplatesVisualStudioCodeGenerationScreencast.aspx">T4 Templates in Visual Studio for Code Generation Screencast</a></li>
</ul>
<p>Props to link blogs<br />
<a href="http://inq.net/Default.aspx">Christopher Steen</a><br />
<a href="http://jasonhaley.com/blog/default.aspx">Jason Haley</a><br />
<a href="http://blog.cwa.me.uk/about/">Chris Alcock</a><br />
<a href="http://www.alvinashcraft.com/">Alvin Ashcraft</a><br />
<a href="http://arjansworld.blogspot.com/">Arjan Zuidhof</a></p>
<img src ="http://www.cnblogs.com/jintan/aggbug/1246432.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41923/" target="_blank">[新闻]福布斯：Facebook网站十大最火爆游戏</a>]]></description></item><item><title>在不修改现有的代码情况下实现SQL Server死锁即时通知</title><link>http://www.cnblogs.com/jintan/archive/2008/07/18/1246417.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Fri, 18 Jul 2008 14:39:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/07/18/1246417.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1246417.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/07/18/1246417.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1246417.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1246417.html</trackback:ping><description><![CDATA[<h4>Post by:Mladen Prajdić : <a href="http://weblogs.sqlteam.com/mladenp/archive/2008/07/18/Immediate-deadlock-notifications-without-changing-existing-code.aspx">Immediate deadlock notifications without changing existing code</a></h4> <p>In my <a href="http://weblogs.sqlteam.com/mladenp/archive/2008/05/21/SQL-Server-2005-Immediate-Deadlock-notifications.aspx"><strong>previous post</strong></a> about immediate deadlock notifications in SQL Server 2005 I've shown a way to use a try catch block to get the deadlock error. <p>The con of this method, although it uses best practice for error handling in SQL Server 2005, is that you have to change existing code and  <p>it doesn't work for non stored procedure code. And that IS a pretty BIG con! As is customary in this blog there is a solution to this. :) <p><strong>SQL Server 2005 Event notifications</strong> <p><a href="http://msdn.microsoft.com/en-us/library/ms182602.aspx"><strong>Event notifications</strong></a> are a special kind of database object that sen:d information about server and database events to a Service Broker service.  <p>They execute in response to a variety of Transact-SQL data definition language (DDL) statements and SQL Trace events by sending information  <p>about these events to a Service Broker service. There are three scopes for event notifications: Server, Database and Queue. <p>We of course want a Server wide deadlock notification so that we can be notified of all deadlocks on the entire server <p>I have to point out that event notification are an awesome use of Service Broker functionality. <p><strong></strong> <p><strong>Setup</strong> <p>For the purpose of this post I've used <strong>tempdb</strong> to hold our deadlock event info. Of course this should go into an administrative database if you have one. <p>Also an email is sent to notify the DBA that the deadlock happened. Thus the Immediate part :)<pre><p>USE tempdb
GO

-- this procedure will write our event data into the table and send the notification email
CREATE PROCEDURE usp_ProcessNotification 
AS
    DECLARE @msgBody XML    
    DECLARE @dlgId uniqueidentifier

    -- you can change this to get all messages at once
    WHILE(1=1)
    BEGIN
        BEGIN TRANSACTION    
        BEGIN TRY        
            -- receive messages from the queue one by one            
            ;RECEIVE TOP(1) 
                    @msgBody    = message_body,
                    @dlgId        = conversation_handle
            FROM    dbo.DeadLockNotificationsQueue
            
            -- exit when the whole queue has been processed
            IF @@ROWCOUNT = 0
            BEGIN
                IF @@TRANCOUNT &gt; 0
                BEGIN 
                    ROLLBACK;
                END  
                BREAK;
            END 

            -- insert event data into our table 
            INSERT INTO TestEventNotification(eventMsg)
            SELECT @msgBody
            
            DECLARE @MailBody NVARCHAR(MAX)    
            SELECT @MailBody = CAST(@msgBody AS NVARCHAR(MAX));

            -- send an email with the defined email profile. 
            -- since this is async it doesn't halt execution
            -- EXEC msdb.dbo.sp_send_dbmail
            --         @profile_name = 'your mail profile', -- your defined email profile 
            --         @recipients = 'dba@yourCompany.com', -- your email
            --         @subject = 'Deadlock occured notification',
            --         @body = @MailBody;
            
            IF @@TRANCOUNT &gt; 0
            BEGIN 
                COMMIT;
            END
        END TRY
        BEGIN CATCH
            IF @@TRANCOUNT &gt; 0
            BEGIN 
                ROLLBACK;
            END
            -- write any error in to the event log
            DECLARE @errorNumber BIGINT, @errorMessage nvarchar(2048), @dbName nvarchar(128)
            SELECT  @errorNumber = ERROR_NUMBER(), @errorMessage = ERROR_MESSAGE(), @dbName = DB_NAME()

            RAISERROR (N'Error WHILE receiving Service Broker message FROM queue DeadLockNotificationsQueue.
                        DATABASE Name: %s; Error number: %I64d; Error Message: %s', 
                        16, 1, @dbName, @errorNumber, @errorMessage) WITH LOG;
        END CATCH;
    END
GO

-- create the notification queue that will receive the event notification messages
-- add the activation stored procedure that will process the messages in the queue
-- as they arrive
CREATE QUEUE DeadLockNotificationsQueue
    WITH STATUS = ON,
    ACTIVATION (
        PROCEDURE_NAME = usp_ProcessNotification,
        MAX_QUEUE_READERS = 1,
        EXECUTE AS 'dbo' );
GO

-- crete the notofication service for our queue with the pre-defined message type
CREATE SERVICE DeadLockNotificationsService
    ON QUEUE DeadLockNotificationsQueue 
                ([http://schemas.microsoft.com/SQL/Notifications/PostEventNotification]);
GO

-- create the route for the service
CREATE ROUTE DeadLockNotificationsRoute
    WITH SERVICE_NAME = 'DeadLockNotificationsService',
    ADDRESS = 'LOCAL';
GO

-- create the event notification for the DEADLOCK_GRAPH event. 
-- other lock events can be added 
CREATE EVENT NOTIFICATION DeadLockNotificationEvent
ON SERVER 
FOR DEADLOCK_GRAPH -- , LOCK_DEADLOCK_CHAIN, LOCK_DEADLOCK, LOCK_ESCALATION -- ANY OF these can be SET
TO SERVICE 'DeadLockNotificationsService', 
           'current database' -- CASE sensitive string that specifies USE OF server broker IN CURRENT db
GO

-- check to see if our event notification has been created ok
SELECT * FROM sys.server_event_notifications WHERE name = 'DeadLockNotificationEvent';
GO

-- create the table that will hold our deadlock info
CREATE TABLE TestEventNotification(Id INT IDENTITY(1,1), EventMsg xml, EventDate datetime default(GETDATE()))
GO

-- clean up
/*
DROP TABLE TestEventNotification
DROP PROCEDURE usp_ProcessNotification
DROP EVENT NOTIFICATION DeadLockNotificationEvent ON SERVER 
DROP ROUTE DeadLockNotificationsRoute
DROP SERVICE DeadLockNotificationsService
DROP QUEUE DeadLockNotificationsQueue
*/</p></pre>
<p><strong>Testing</strong>
<p>For testing you'll need to open 2 windows in SQL Server Management Studio<pre><p>-- tun this first to create the test table 
USE AdventureWorks
IF object_id('DeadlockTest') IS NOT NULL 
    DROP TABLE DeadlockTest 
GO
CREATE TABLE DeadlockTest ( id INT)
INSERT INTO DeadlockTest
SELECT 1 UNION ALL
SELECT 2
GO
----------------------------------------------------------------
----------------------------------------------------------------
-- run this in query window 1
BEGIN TRAN

UPDATE DeadlockTest 
SET id = 12
WHERE id = 2

-- wait 5 secs to set up deadlock condition in other window
WAITFOR DELAY '00:00:05'

UPDATE DeadlockTest 
SET id = 11
WHERE id = 1

COMMIT

----------------------------------------------------------------
----------------------------------------------------------------
-- run this in query window 2 a second or two 
-- after you've run the script in query window 1
BEGIN TRAN

UPDATE DeadlockTest 
SET id = 11
WHERE id = 1

-- wait 5 secs to set up deadlock condition in other window
WAITFOR DELAY '00:00:05'

UPDATE DeadlockTest 
SET id = 12
WHERE id = 2

COMMIT
----------------------------------------------------------------
----------------------------------------------------------------

-- run this after the test to see that we have our deadlock event notification saved
USE tempdb
SELECT * FROM TestEventNotification
ORDER BY id</p></pre>
<p>We can see that this setup works great. Because we have subscribed to the DEADLOCK_GRAPH event we can see the same information 
<p>as if we had traced it with the SQL Profiler. Of course this kind of setup can be used for any kind of event that is supported.
 <img src ="http://www.cnblogs.com/jintan/aggbug/1246417.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41923/" target="_blank">[新闻]福布斯：Facebook网站十大最火爆游戏</a>]]></description></item><item><title>在Winform的DataGridView的单元格中同时显示文本和图标，以及树形结构的示例</title><link>http://www.cnblogs.com/jintan/archive/2008/07/17/1244830.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Thu, 17 Jul 2008 00:49:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/07/17/1244830.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1244830.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/07/17/1244830.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1244830.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1244830.html</trackback:ping><description><![CDATA[<p></p> <ul> <li>树形结构的DataGridView:<a href="http://blogs.msdn.com/markrideout/archive/2006/01/08/customizing-the-datagridview-to-support-expanding-collapsing-ala-treegridview.aspx">Customizing the DataGridView to support expanding/collapsing (ala TreeGridView)</a>&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://blogs.msdn.com/markrideout/archive/tags/DataGridView/default.aspx">DataGridView</a></li> <ul> <li></li><img src="http://www.windowsforms.net/blogs/markrideout/treegridview.png"> <ul> <h6>&nbsp;</h6> <h6>TreeGridView 修正版本：</h6> <p>Some people reported problems actually running the TreeGridView sample, so I've recompiled it on an RTM build machine (previously I was using the latest internal VS build). You can get the new version (that also includes release &amp; debug binaries prebuilt) here: <a href="http://www.windowsforms.net/blogs/markrideout/TreeGridViewRebuilt.zip">http://www.windowsforms.net/blogs/markrideout/TreeGridViewRebuilt.zip</a></p></ul></ul></ul> <p>&nbsp;</p> <ul> <li>单元格中同时显示文本和图标</li></ul> <p>The DataGridView control does not have any built-in support for showing an icon and text in the same cell. Through the different painting customization events, such as the CellPaint event, you can easily display an icon next to the text in the cell.  <p>The following example extends the DataGridViewTextColumn and cell to paint an image next to the text. The sample uses the DataGridViewCellStyle.Padding property to adjust the text location and overrides the Paint method to paint an icon. This sample can be simplified by handling the CellPainting event and performing similar code.</p><pre><span style="color: #0000ff">using</span> System;
<span style="color: #0000ff">using</span> System.Collections.Generic;
<span style="color: #0000ff">using</span> System.Linq;
<span style="color: #0000ff">using</span> System.Text;
<span style="color: #0000ff">using</span> System.Windows.Forms;
<span style="color: #0000ff">using</span> System.Drawing;

<span style="color: #0000ff">namespace</span> JrtGenerator.Utility
{
    <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> TextAndImageColumn : DataGridViewTextBoxColumn
    {
        <span style="color: #0000ff">private</span> Image imageValue;
        <span style="color: #0000ff">private</span> Size imageSize;
        <span style="color: #0000ff">public</span> TextAndImageColumn()
        {
            <span style="color: #0000ff">this</span>.CellTemplate = <span style="color: #0000ff">new</span> TextAndImageCell();
        }

        <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">object</span> Clone()
        {
            TextAndImageColumn c = <span style="color: #0000ff">base</span>.Clone() <span style="color: #0000ff">as</span> TextAndImageColumn;
            c.imageValue = <span style="color: #0000ff">this</span>.imageValue;
            c.imageSize = <span style="color: #0000ff">this</span>.imageSize;
            <span style="color: #0000ff">return</span> c;
        }

        <span style="color: #0000ff">public</span> Image Image
        {
            <span style="color: #0000ff">get</span>
            {
                <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.imageValue;
            }
            <span style="color: #0000ff">set</span>
            {
                <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.Image != <span style="color: #0000ff">value</span>)
                {
                    <span style="color: #0000ff">this</span>.imageValue = <span style="color: #0000ff">value</span>;
                    <span style="color: #0000ff">this</span>.imageSize = <span style="color: #0000ff">value</span>.Size;
                    <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.InheritedStyle != <span style="color: #0000ff">null</span>)
                    {
                        Padding inheritedPadding = <span style="color: #0000ff">this</span>.InheritedStyle.Padding;
                        <span style="color: #0000ff">this</span>.DefaultCellStyle.Padding = <span style="color: #0000ff">new</span> Padding(imageSize.Width, inheritedPadding.Top, inheritedPadding.Right, inheritedPadding.Bottom);
                    }
                }
            }
        }

        <span style="color: #0000ff">private</span> TextAndImageCell TextAndImageCellTemplate
        {
            <span style="color: #0000ff">get</span>
            {
                <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.CellTemplate <span style="color: #0000ff">as</span> TextAndImageCell;
            }
        }
        <span style="color: #0000ff">internal</span> Size ImageSize
        {
            <span style="color: #0000ff">get</span>
            {
                <span style="color: #0000ff">return</span> imageSize;
            }
        }
    }

    <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> TextAndImageCell : DataGridViewTextBoxCell
    {
        <span style="color: #0000ff">private</span> Image imageValue;

        <span style="color: #0000ff">private</span> Size imageSize;

        <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">object</span> Clone()
        {
            TextAndImageCell c = <span style="color: #0000ff">base</span>.Clone() <span style="color: #0000ff">as</span> TextAndImageCell;
            c.imageValue = <span style="color: #0000ff">this</span>.imageValue;
            c.imageSize = <span style="color: #0000ff">this</span>.imageSize;
            <span style="color: #0000ff">return</span> c;
        }

        <span style="color: #0000ff">public</span> Image Image
        {
            <span style="color: #0000ff">get</span>
            {
                <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.OwningColumn == <span style="color: #0000ff">null</span> || <span style="color: #0000ff">this</span>.OwningTextAndImageColumn == <span style="color: #0000ff">null</span>)
                {
                    <span style="color: #0000ff">return</span> imageValue;
                }
                <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.imageValue != <span style="color: #0000ff">null</span>)
                {
                    <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.imageValue;
                }
                <span style="color: #0000ff">else</span>
                {
                    <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.OwningTextAndImageColumn.Image;
                }
            }
            <span style="color: #0000ff">set</span>
            {
                <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.imageValue != <span style="color: #0000ff">value</span>)
                {
                    <span style="color: #0000ff">this</span>.imageValue = <span style="color: #0000ff">value</span>;
                    <span style="color: #0000ff">this</span>.imageSize = <span style="color: #0000ff">value</span>.Size;
                    Padding inheritedPadding = <span style="color: #0000ff">this</span>.InheritedStyle.Padding;
                    <span style="color: #0000ff">this</span>.Style.Padding = <span style="color: #0000ff">new</span> Padding(imageSize.Width, inheritedPadding.Top, inheritedPadding.Right, inheritedPadding.Bottom);
                }
            }
        }

        <span style="color: #0000ff">protected</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, <span style="color: #0000ff">int</span> rowIndex, DataGridViewElementStates cellState, <span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, <span style="color: #0000ff">object</span> formattedValue, <span style="color: #0000ff">string</span> errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts)
        {
            <span style="color: #008000">// Paint the base content</span>
            <span style="color: #0000ff">base</span>.Paint(graphics, clipBounds, cellBounds, rowIndex, cellState, <span style="color: #0000ff">value</span>, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts);
            <span style="color: #0000ff">if</span> (<span style="color: #0000ff">this</span>.Image != <span style="color: #0000ff">null</span>)
            {
                <span style="color: #008000">// Draw the image clipped to the cell.</span>
                System.Drawing.Drawing2D.GraphicsContainer container = graphics.BeginContainer();
                graphics.SetClip(cellBounds);
                graphics.DrawImageUnscaled(<span style="color: #0000ff">this</span>.Image, cellBounds.Location);
                graphics.EndContainer(container);
            }
        }

        <span style="color: #0000ff">private</span> TextAndImageColumn OwningTextAndImageColumn
        {
            <span style="color: #0000ff">get</span>
            {
                <span style="color: #0000ff">return</span> <span style="color: #0000ff">this</span>.OwningColumn <span style="color: #0000ff">as</span> TextAndImageColumn;
            }
        }
    }

}
</pre><img src ="http://www.cnblogs.com/jintan/aggbug/1244830.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41922/" target="_blank">[新闻]谷歌允许用户评论搜索结果调整顺序</a>]]></description></item><item><title>My interested stuff(2008-07-14)</title><link>http://www.cnblogs.com/jintan/archive/2008/07/14/1242883.html</link><dc:creator>代码乱了</dc:creator><author>代码乱了</author><pubDate>Mon, 14 Jul 2008 12:36:00 GMT</pubDate><guid>http://www.cnblogs.com/jintan/archive/2008/07/14/1242883.html</guid><wfw:comment>http://www.cnblogs.com/jintan/comments/1242883.html</wfw:comment><comments>http://www.cnblogs.com/jintan/archive/2008/07/14/1242883.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnblogs.com/jintan/comments/commentRss/1242883.html</wfw:commentRss><trackback:ping>http://www.cnblogs.com/jintan/services/trackbacks/1242883.html</trackback:ping><description><![CDATA[<p><strong>Add-ins</strong></p> <ul> <li>Peter Eysermans -&nbsp; <a href="http://peter.worksontheweb.net/post/Aggiorno2c-the-Italian-colleague-youve-always-wanted.aspx">review of Aggiorno</a>, 一个VS2005-2008的插件，可以帮助页面开发者整理HTML,提高HTML代码的兼容性,  <ul> <li>包括：清理垃圾HTML,  <li>统一为页面的所有&lt;img&gt; 添加Alternate属性，当img的图片显示错误时，会显示默认的图片  <li>分配Tab Index  <li>搜索页面的必然&lt;FONT&gt;或&lt;CENTER&gt;标记，用css代替</li></ul></li></ul> <p>&nbsp;</p> <ul> <li>DiveDeeper blog announced the <a href="http://www.architekturaforum.hu/blogs/divedeeper/archive/2008/07/08/LearnVSXNowPart24.aspx">creation of the VSXtra project on CodePlex</a>.&nbsp; The project will build upon the Managed Package Framework to provide greater programmer productivity when creating VSPackages.( <strong>* * *</strong> 快速创建托管VSX的的VSPackages,<strong>对要开发VS插件的朋友很有帮助</strong>) <li><a href="http://www.codeproject.com/KB/miscctrl/ScriptEditorCtrl.aspx">.Net Script Editor (C#,Vb.net Mini IDE)</a> .net脚本编辑器，从作者发布的界面动画来看貌似很强大，我还没有试，有兴趣的朋友可以看看</li> <ul> <p><br><img height="536" src="http://www.codeproject.com/KB/miscctrl/ScriptEditorCtrl/Animation7.gif" width="779"></p></ul></ul> <p>&nbsp;</p> <p><strong>.Web</strong></p> <ul> <li><a title="Open Source ASP.NET Web Applications" href="http://www.blogfodder.co.uk/post/2008/07/List-Of-Free--Open-Source-ASPNET-Web-Applications.aspx">Open Source ASP.NET Web Applications</a>(包括，博客，论坛，购物车，内容管理系统，CRM,E-mail系统)  <li><a href="http://digcode.com/default.aspx?page=ed51cde3-d979-4daf-afae-fa6192562ea9&amp;article=08826958-b3f1-4138-a163-5231ac2d5e42">How to Disable the AuotComplete Feature Programatically in ASP.NET?（</a>怎样通过ASP.net编程实现禁用客户端的自动完成功能）  <li><a title="Cheat Sheets for Front-end Web Developers" href="http://sixrevisions.com/resources/cheat_sheets_web_developer/">Cheat Sheets for Front-end Web Developers</a>(包括23个很用的，前台开发经常用到的速查备忘录，包括css,javascript ,jquery,颜色等等)  <li><a title="55 Free High Quality Icon Sets" href="http://www.smashingmagazine.com/2008/07/02/55-free-high-quality-icon-sets/">55 Free High Quality Icon Sets</a>（55套高质量非常漂亮的专业图标库）  <ul><img height="457" alt="Freebies Icons" src="http://88.198.60.17/images/fresh-icons/shiny.jpg" width="460"></ul></li></ul> <p>&nbsp;</p> <p><strong>Tools</strong></p> <ul> <li><a title="Useful Diagnostic Tools" href="http://www.adrianbanks.co.uk/?p=59">Useful Diagnostic Tools</a>(一些有用的诊断工具)  <li><a href="http://www.dimecasts.net/Casts/CastDetails/21">Creating an Automated Build for your Application</a> 为你的应用程序创建自动构建</li></ul><img src ="http://www.cnblogs.com/jintan/aggbug/1242883.html?type=1" width = "1" height = "1" /><br><br><a href="http://news.cnblogs.com/n/41921/" target="_blank">[新闻]Internet 另一超级漏洞被公布</a>]]></description></item></channel></rss>