<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.geekdojo.net/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Richard's C# blog</title><link>http://blogs.geekdojo.net/richard/default.aspx</link><description>I refer you to the blog title</description><dc:language>en-US</dc:language><generator>CommunityServer 2.0 (Build: 60217.2664)</generator><item><title>C# 3.0: Invoke On WinForm Conrols easily with Lambda expressions (or anonymous methods)</title><link>http://blogs.geekdojo.net/richard/archive/2008/02/22/2022290454.aspx</link><pubDate>Sat, 23 Feb 2008 02:43:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:2022290454</guid><dc:creator>richard</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/2022290454.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=2022290454</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/2022290454.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I really like Extension methods... especially when you combine them with other good language bits to really make a difficult problem a lot easier.&amp;nbsp; I think invoking on Windows Forms applications is one of those problems that is elegantly solved by some of these new features.&amp;nbsp; For an in-depth background on the 'whys' and details of having to use Invoke to access GUI elements from other threads in your windows forms applications, see &lt;A href="http://weblogs.asp.net/justin_rogers/articles/126345.aspx"&gt;this article&lt;/A&gt;.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I have always found stopping to Invoke something to be a bit of a pain -&amp;nbsp; just enough effort to derail my train of thought while working on a WinForms applications.&amp;nbsp; So back in the 1.1 days, I created some helper code to try to smooth this process out a bit.&amp;nbsp; On method to help out invoke was called like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;string value = InvokeHelper.GetProperty(myTextBox, "Text");&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This was an improvement on invoking without help, but essentially all I was doing was wrapping some reflection calls to coax the value from the Text property.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Now, with extention methods, lambda expressions and the ability of the compiler to infer the resolution of generic type parameters&amp;nbsp;to actual types, I was able to refactor many helper methods (variations on the above for getting and setting properties, fields, calling methods, and their overloads into two methods, this is the first:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;public static TResult Invoke&amp;lt;T, TResult&amp;gt;(this T controlToInvokeOn, Func&amp;lt;TResult&amp;gt; code) where T : Control&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp; if (controlToInvokeOn.InvokeRequired)&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (TResult)controlToInvokeOn.Invoke(code);&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp; else&lt;BR&gt;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (TResult)code();&lt;BR&gt;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This handles the majority of cases where I wish to invoke in WinForms, it's available on all Control instanced&amp;nbsp;(though I usually just invoke on the main Form instance where the controls I want to touch are) and it works without having to specifiy the return type (or where there are no return types *except in cases where the Func code isn't an expression... see below for the second method/case).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The other method is this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;FONT face="Courier New" color=#000080&gt;public static void Invoke(this Control controlToInvokeOn, Func code)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (controlToInvokeOn.InvokeRequired)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;controlToInvokeOn.Invoke(code);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;code();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This method has some overlap with the previous method, but its exclusive territory is cases where you pass something to the 'code' parameter that *isn't* an expression.&amp;nbsp; In this overload, you are passing in a delegate defined as &lt;FONT face="Courier New" color=#000080&gt;public delegate void Func()&lt;/FONT&gt; (which is not included in the framework, I just made it up though I could have easily used the ThreadStart delegate -- hmm, maybe I should have, oh well :)).&amp;nbsp; This can be a multi-step method that includes locals etc. just like any anonymous method would.&amp;nbsp; The first overload of Invoke would require you to return something at the end of your method, which I thought was ugly, so I added this second method for 'code aesthetic' purposes.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;[Edit] One obvious thing I left out (you can tell I haven't blogged much recently) is is just the syntax of how this is called.&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;Inside a Form (this), you call the method like so (in this case, setting a value on a control on the UI thread):&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;this.Invoke(() =&amp;gt; progressBar1.Value = i);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This gives you easier syntax than the out of the box invoke, and only invokes if it needs to.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Returning a value from a property is pretty easy, too:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000080 size=2&gt;string value = this.Invoke(() =&amp;gt; button1.Text);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The return type is resolved implicitly so you never need to cast and normally shouldn't need to explicitly supply it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Anyway, I would like to improve this if I can.&amp;nbsp; One question: is it wrong to overload the 'Invoke' method?&amp;nbsp; If yes, what name should these methods have?&amp;nbsp; Any other comments or questions are welcomel&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Here's the code:&lt;BR&gt;&lt;A href="http://cid-562a3b0e5827e3b4.skydrive.live.com/self.aspx/Demo%20code/DemonstrateInvokeViaLambdas.zip"&gt;DemonstrateInvokeViaLambdas.zip&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=2022290454" width="1" height="1"&gt;</description></item><item><title>Microsoft Dynamics CRM Web Services: How to join entities to filter QueryExpression results</title><link>http://blogs.geekdojo.net/richard/archive/2007/06/07/136214.aspx</link><pubDate>Thu, 07 Jun 2007 11:39:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:136214</guid><dc:creator>richard</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/136214.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=136214</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/136214.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;There just isn't much information out there about Microsoft Dynamics CRM Web Services... at least not when compared to other technologies.&amp;nbsp; And with &lt;/FONT&gt;&lt;A href="http://silverlight.net/"&gt;&lt;FONT face=Verdana size=2&gt;Silverlight &lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;and &lt;/FONT&gt;&lt;A href="http://www.microsoft.com/surface/"&gt;&lt;FONT face=Verdana size=2&gt;Surface &lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;and &lt;/FONT&gt;&lt;A href="http://www.popfly.com/"&gt;&lt;FONT face=Verdana size=2&gt;PopFly&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;burning up the MS blogosphere, it's kind of understandable.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Still, there are those of us who need to get things done in &lt;A href="http://www.microsoftdynamicshome.com/?source=ksg"&gt;Microsoft Dynamics CRM&lt;/A&gt;... and so here's my little contribution.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;It's probably not obvious what I was trying to accomplish from the title of this post.&amp;nbsp; It's very simple, though.&amp;nbsp; Let's say I want to get a list of customers from the CRM filtered by criteria in a table that is several 'joins' away.&amp;nbsp; So in SQL using the sample AdventureWorks DB it looks like this:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Verdana&gt;&lt;FONT color=#0000ff&gt;
&lt;P&gt;&lt;FONT size=2&gt;SELECT&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;FONT color=#808080&gt;*&lt;/FONT&gt; &lt;FONT color=#0000ff&gt;FROM&lt;/FONT&gt; Sales&lt;FONT color=#808080&gt;.&lt;/FONT&gt;Customer c&lt;BR&gt;&lt;FONT color=#808080&gt;INNER&lt;/FONT&gt; &lt;FONT color=#808080&gt;JOIN&lt;/FONT&gt; Sales&lt;FONT color=#808080&gt;.&lt;/FONT&gt;CustomerAddress ca&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ON&lt;/FONT&gt; c&lt;FONT color=#808080&gt;.&lt;/FONT&gt;CustomerId &lt;FONT color=#808080&gt;=&lt;/FONT&gt; ca&lt;FONT color=#808080&gt;.&lt;/FONT&gt;CustomerId&lt;BR&gt;&lt;FONT color=#808080&gt;INNER&lt;/FONT&gt; &lt;FONT color=#808080&gt;JOIN&lt;/FONT&gt; Person&lt;FONT color=#808080&gt;.&lt;/FONT&gt;Address a&lt;BR&gt;&lt;FONT color=#0000ff&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;ON&lt;/FONT&gt; ca&lt;FONT color=#808080&gt;.&lt;/FONT&gt;AddressId &lt;FONT color=#808080&gt;=&lt;/FONT&gt; a&lt;FONT color=#808080&gt;.&lt;/FONT&gt;AddressId&lt;BR&gt;&lt;FONT color=#0000ff&gt;WHERE&lt;/FONT&gt; City &lt;FONT color=#808080&gt;=&lt;/FONT&gt; &lt;FONT color=#ff0000&gt;'Montreal'&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT color=#000000 size=2&gt;So now my CRM Web Services goal is more clear.&amp;nbsp; I had this requirement and there wasn't much I could find about doing&amp;nbsp;it, but I managed to cobble together this sample.&amp;nbsp; Keep in mind the code I'm going to show you is *not* representative of our CRM or its custom fields, it's just how you would do it, mirroring the AdventureWorks SQL snippet above.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT color=#000000&gt;&lt;FONT size=2&gt;First thing I found handy was a nice built-in entity and relationship list the CRM comes with.&amp;nbsp; Navigate to &lt;/FONT&gt;&lt;A href="http://yourcrmservername/sdk/list.aspx"&gt;&lt;FONT size=2&gt;http://YourCrmServerName/sdk/list.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt; to get to the Microsoft CRM MetaData browser with all the entities you can connect to from your CRM's web service. (The service URL, btw should be &lt;/FONT&gt;&lt;A href="http://youcrmservername//mscrmservices/2006/crmservice.asmx"&gt;&lt;FONT size=2&gt;http://YouCrmServername//mscrmservices/2006/crmservice.asmx&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=2&gt;).&amp;nbsp; Here's my real-but-pseudo code showing how to do this many-to-many join scenario to filter results.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;CrmService cs = new CrmService();&lt;BR&gt;cs.Credentials = new System.Net.NetworkCredential("user", "password", "domain");&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;QueryExpression customerQuery&amp;nbsp; = new QueryExpression();&lt;BR&gt;customerQuery.EntityName = EntityName.customer.ToString(); &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;// Prepare the first 'INNER JOIN' to the many to many table:&lt;BR&gt;LinkEntity innerJoinOne = new LinkEntity();&lt;BR&gt;// LinkFromEntityName == same as our QueryExpression.EntityName&lt;BR&gt;innerJoinOne.LinkFromEntityName = EntityName.customer.ToString();&lt;BR&gt;// attribute is like the 'ON' clause&lt;BR&gt;innerJoinOne.LinkFromAttributeName = "customerId";&amp;nbsp; &lt;BR&gt;innerJoinOne.LinkToEntityName = EntityName.customeraddress.ToString();&lt;BR&gt;// don't assume this is the same as the primary key table&lt;BR&gt;// look it up in the metadata browser!&lt;BR&gt;innerJoinOne.LinkToAttributeName = "customerId";&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;// Prepare the second join, to the table that holds the criteria &lt;BR&gt;// field we want to specify&lt;BR&gt;LinkEntity innerJoinTwo = new LinkEntity();&lt;BR&gt;// here LinkFromEntityName should == same as the LinkToEntityName in our &lt;BR&gt;// first LinkEntity&lt;BR&gt;innerJoinTwo.LinkFromEntityName = EntityName.customeraddress.ToString();&lt;BR&gt;innerJoinTwo.LinkFromAttributeName = "addressId";&lt;BR&gt;innerJoinTwo.LinkToEntityName = EntityName.address.ToString();&lt;BR&gt;linkinnerJoinTwoTwo.LinkToAttributeName = "addressId";&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;// now make the CRM WS equivalent of our 'WHERE' clause:&lt;BR&gt;ConditionExpression where = new ConditionExpression();&lt;BR&gt;where.Operator = ConditionOperator.Equal;&lt;BR&gt;where.AttributeName = "city";&lt;BR&gt;where.Values = new object[] { "Montreal" };&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;// in this case, we attach the ConditionExpression inside&lt;BR&gt;// a FilterExpression, then to the LinkCriteria property&lt;BR&gt;// on the 2nd LinkEntity&lt;BR&gt;FilterExpression filter = new FilterExpression();&lt;BR&gt;filter.Conditions = new ConditionExpression[] { condition };&lt;BR&gt;innerJoinTwo.LinkCriteria = filter;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;// Then you attach the 2nd LinkEntity, to the first one&lt;BR&gt;innerJoinOne.LinkEntities = new LinkEntity[] { innerJoinTwo };&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;// Then the first one to the QueryExpression. &lt;BR&gt;customerQuery.LinkEntities = new LinkEntity[] { innerJoinOne };&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;BusinessEntityCollection customerEntities = cs.RetrieveMultiple(customerQuery);&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;FONT color=#000000 size=2&gt;I hope that makes some sense, and saves some of the frustration I had in getting there.&amp;nbsp; If there's anything unclear, please comment and I'll try to answer.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT color=#ff0000&gt;&lt;FONT color=#000000&gt;Later,&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000&gt;&lt;FONT color=#000000&gt;Richard&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=136214" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richard/archive/category/7.aspx">.NET</category><category domain="http://blogs.geekdojo.net/richard/archive/category/8.aspx">C#</category><category domain="http://blogs.geekdojo.net/richard/archive/category/1051.aspx">Microsoft CRM</category></item><item><title>Super easy SQL Server 2005 Database Schema change auditing</title><link>http://blogs.geekdojo.net/richard/archive/2007/06/04/134600.aspx</link><pubDate>Mon, 04 Jun 2007 07:24:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:134600</guid><dc:creator>richard</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/134600.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=134600</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/134600.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I love the xml type in SQL Server 2005.&amp;nbsp; Here's a very simple way I made&amp;nbsp;use of it: I audit all the object/schema changes to the database with a simple database-level trigger.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;First, I create a very simple table (inside a schema I name 'Audit'): &lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TABLE&lt;/FONT&gt;&lt;FONT size=2&gt; [Audit]&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;[Objects]&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;[EventID] [int] &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;IDENTITY&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt;1&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;NOT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;NULL,&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;[EventData] [xml] &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;NULL,&lt;/P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;PRIMARY&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;KEY&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CLUSTERED&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp; [EventID] &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ASC&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;WITH&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;IGNORE_DUP_KEY &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;OFF&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT size=2&gt; [PRIMARY]&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT size=2&gt; [PRIMARY]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;Then, the trigger:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;CREATE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TRIGGER&lt;/FONT&gt;&lt;FONT size=2&gt; [Trig_AuditObjects]&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DATABASE&lt;BR&gt;FOR&lt;/FONT&gt;&lt;FONT size=2&gt; DDL_DATABASE_LEVEL_EVENTS &lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;AS&lt;BR&gt;INSERT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; Audit&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;Objects&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;EventData&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;SELECT&lt;/FONT&gt;&lt;FONT size=2&gt; EVENTDATA&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;()&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;GO&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ENABLE&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;TRIGGER&lt;/FONT&gt;&lt;FONT size=2&gt; [Trig_AuditObjects] &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DATABASE&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face=Verdana color=#000000&gt;That's it.. now I get a nice neat little xml entry in my table every time a DDL database level event happens, like so:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;EVENT_INSTANCE&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;EventType&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;ALTER_TABLE&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;EventType&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;PostTime&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;2007-06-03T20:12:05.813&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;PostTime&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;SPID&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;55&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;SPID&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ServerName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;CHI100906&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ServerName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;LoginName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;MYDOMAIN\myusername&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;LoginName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;UserName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;dbo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;UserName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;DatabaseName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;Sales&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;DatabaseName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;SchemaName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;dbo&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;SchemaName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ObjectName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;Products&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ObjectName&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ObjectType&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;TABLE&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;ObjectType&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;TSQLCommand&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;SetOptions&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ANSI_NULLS&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ANSI_NULL_DEFAULT&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ANSI_PADDING&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; QUOTED_IDENTIFIER&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;ON&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;ENCRYPTED&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FALSE&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;"&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt; /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;CommandText&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT color=#000000&gt;ALTER TABLE dbo.Products&lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DROP COLUMN testremove&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;CommandText&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;TSQLCommand&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;BR&gt;&amp;lt;/&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;EVENT_INSTANCE&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face=Verdana color=#000000&gt;The &lt;A href="http://technet.microsoft.com/en-us/library/ms187909.aspx"&gt;EVENTDATA&lt;/A&gt;() function is provided by SQL Server inside a DDL trigger and provides all the data you see above as an xml document.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT face=Verdana color=#000000&gt;I like having this during development -&amp;nbsp;it's like a poor man's source control for my schema changes.&amp;nbsp; But also, it could come in very handy for forensic purposes when diagnosing post-rollout issues or accidental schema changes.&amp;nbsp; Anyway, it's simple and handy for what it does.&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=134600" width="1" height="1"&gt;</description></item><item><title>SQL Server 2005 XQuery does not implement XQuery 1.0 / XPath 2.0 fully</title><link>http://blogs.geekdojo.net/richard/archive/2007/05/29/133246.aspx</link><pubDate>Wed, 30 May 2007 04:33:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:133246</guid><dc:creator>richard</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/133246.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=133246</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/133246.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;A coworker of mine was trying to apply the XPath 2.0 upper-case() function to some shredded xml from a query in SQL Server 2005 and inquired about it with me just before heading out the door.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Here's what's happening: You try to apply&amp;nbsp;the upper-case&amp;nbsp;function (that exists in the &lt;A href="http://www.w3.org/TR/xpath-functions/"&gt;XQuery 1.0 / XPath 2.0 standard&lt;/A&gt;) to, say, the result from a .value() method call on some stored xml and you get this lovely message:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=1&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;Msg 2395, Level 16, State 1, Line 4&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;XQuery [value()]: There is no function '{http://www.w3.org/2004/07/xpath-functions}:upper-case()'&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT size=2&gt;&lt;FONT face=Verdana&gt;And turns out it's not lying....&amp;nbsp; per &lt;A href="http://sqljunkies.com/WebLog/mrys/"&gt;Michael Rys&lt;/A&gt; in &lt;/FONT&gt;&lt;A href="http://groups.google.com/group/microsoft.public.sqlserver.xml/browse_thread/thread/53b0a7024afc8b9a/372da231cd37efac?lnk=st&amp;amp;q=XQuery+%5Bvalue()%5D%3A+%22There+is+no+function%22&amp;amp;rnum=1&amp;amp;hl=en#372da231cd37efac"&gt;&lt;FONT face=Verdana&gt;this&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; post on &lt;/FONT&gt;&lt;A href="http://groups.google.com/group/microsoft.public.sqlserver.xml/topics?hl=en"&gt;&lt;FONT face=Verdana&gt;microsoft.public.sqlserver.xml&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt;&amp;nbsp;the standard is not fully implemented (even though it refers to it in the error message, and browsing &lt;/FONT&gt;&lt;A href="http://www.w3.org/2004/07/xpath-functions"&gt;&lt;FONT face=Verdana&gt;http://www.w3.org/2004/07/xpath-functions&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana&gt; does show upper-case() as a function).&amp;nbsp;&amp;nbsp; &lt;A href="http://msdn2.microsoft.com/en-us/library/ms189254.aspx"&gt;But SQL Server only supports&lt;/A&gt;:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms190972.aspx"&gt;concat&lt;/A&gt;&lt;BR&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms178026.aspx"&gt;contains&lt;/A&gt;&lt;BR&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms178063.aspx"&gt;substring&lt;/A&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;and&lt;BR&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms188700.aspx"&gt;string-length&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;FONT face=Verdana size=2&gt;on strings :(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;BR&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=133246" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richard/archive/category/7.aspx">.NET</category><category domain="http://blogs.geekdojo.net/richard/archive/category/8.aspx">C#</category><category domain="http://blogs.geekdojo.net/richard/archive/category/1034.aspx">Sql Server 2005</category></item><item><title>Mashups of the mp3 Kind</title><link>http://blogs.geekdojo.net/richard/archive/2007/05/15/128647.aspx</link><pubDate>Wed, 16 May 2007 06:17:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:128647</guid><dc:creator>richard</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/128647.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=128647</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/128647.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Well, I finally brought my first career (recording engineer) together with my love of the pop-culture phenom of &lt;/FONT&gt;&lt;A href="http://en.wikipedia.org/wiki/Bastard_pop"&gt;&lt;FONT face=Verdana size=2&gt;mashups&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;to release my first mashup to the world:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma color=#0000ff size=2&gt;&lt;STRONG&gt;&lt;A href="http://www.aleth.org/DJ%20DonJay%20-%20Unbelievable%20Disco%20Lolita%20Tale%20to%20Tell.zip"&gt;Unbelievable Disco Lolita Tale to Tale&lt;/A&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;That's Alizée's international hit "Moi Lolita" with overdubs of Love and Rocket's "No New Tale to Tell", U2's "Discothèque" and EMF's "Unbelievable".&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;It was fun to do, but I'm not sure I'll have much time to do more - in the meantime, hope you like it.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=128647" width="1" height="1"&gt;</description></item><item><title>Sql Server 2005 Full-text Thesaurus: Abyss of failure and paucity of imagination</title><link>http://blogs.geekdojo.net/richard/archive/2006/09/01/13805.aspx</link><pubDate>Fri, 01 Sep 2006 15:04:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:13805</guid><dc:creator>richard</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/13805.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=13805</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/13805.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&lt;A HREF="/ryan"&gt;Ryan&lt;/A&gt; introduced me to the MS idea of &lt;A href="http://www.google.com/search?hl=en&amp;amp;q=%22pit+of+success%22"&gt;"Pit of Success"&lt;/A&gt; where you just fall into using things the right way from the obvious way their API indicates use (form shows function).&amp;nbsp; I'm simplifying, I'm sure, but that's the gist.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;In trying to get the Sql Server 2005 thesaurus to work, I have stumbled into the opposite: a pit of failure.&amp;nbsp; We have all felt ourselves fall into this pit at one time or another with a product or framework&amp;nbsp;or API we've used.&amp;nbsp; One where we curse under our breath and promise ourselves that we will never force consumers of our APIs to go through what we are now.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Such is the thesaurus feature of Sql Server 2005's full-text search functionality.&amp;nbsp; Among the attributes of this particular feature that single it out for 'constructive criticism':&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;The naming scheme of the files is based in 3-digit language codes.&amp;nbsp; This means the tsEng.xml is NOT the thesaurus you edit, Americans (that's me, btw) it's tsEn&lt;STRONG&gt;&lt;EM&gt;&lt;U&gt;U&lt;/U&gt;&lt;/EM&gt;&lt;/STRONG&gt;.xml - okay, I'm just an idiot on this one.&amp;nbsp; But it's still, imo, a pit of success violation.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;The xml&amp;nbsp;files are written in unicode with &lt;A href="http://www.unicode.org/unicode/faq/utf_bom.html#22"&gt;byte order marks&lt;/A&gt; and they cease to work if the byte order marks aren't written with the text file is.&amp;nbsp;TextPad, which, oh,&amp;nbsp;a few developers use here and there ;) doesn't write the byte order marks by default.&amp;nbsp; Maybe that's TextPad's fault, but frankly, IE can render lots of web pages with some pretty effed-up html and make them human readable, why can't they load a stupid xml file for an English-localized db without byte marks?&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;The thesaurus files are read into memory after a Sql Server service restart (well, technically at the first catalog query after a restart) and can't be changed without the server being restarted!&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;Certain benign-looking data arrangements actually cause the entire thesaurus to fail to work.&amp;nbsp; I'm not certain of all of them, but it appears that&amp;nbsp;having an &amp;lt;expansion&amp;gt; tag where one of the substitution words is a contained in another word is one case.&amp;nbsp; So if you have &amp;lt;expansion&amp;gt;&amp;lt;sub&amp;gt;cover&amp;lt;/sub&amp;gt;&amp;lt;sub&amp;gt;recover&amp;lt;/sub&amp;gt;&amp;lt;/expansion&amp;gt; it appears to me your entire thesaurus will fail to work.&amp;nbsp; Combine that with having to re-start sql sever to test the fixes to your problems and you get a&amp;nbsp;lot of wasted tiem.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;When something in the file fails, causing the whole thing to fail, it writes an unhelpful entry to the windows application log (not the sql server logs).&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;The thesaurus file is per instance (AFAICT) meaning if you want a diff. thesaurus for a different application's full-text catalog, you have to install another (named) instance on your server - double ug.&lt;/FONT&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I don't know about you, but, frankly, I could have written a nice tokenizer and synonym injection API in the time I took trying to figure out the crappyness of the thesaurus xml.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;It's too bad, because in Sql Server 2005 there are some pretty stunning pits of success.&amp;nbsp; The SMO, for me, was like this.&amp;nbsp; Objects to manage your database that made a lot of sense.&amp;nbsp;&amp;nbsp; Anyway, I'm done with the thesaurus.&amp;nbsp; I can whole-heartedly NOT recommend it.&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Verdana size=2&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=13805" width="1" height="1"&gt;</description></item><item><title>Sql Server 2005 Thesaurus File: Fun with(out) Unicode</title><link>http://blogs.geekdojo.net/richard/archive/2006/09/01/13804.aspx</link><pubDate>Fri, 01 Sep 2006 13:04:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:13804</guid><dc:creator>richard</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/13804.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=13804</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/13804.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;[Edited to correct my stupidity about the Unicode thing]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;&amp;lt;sigh&amp;gt;&amp;nbsp; After a few frustrating hours trying to get the full-text indexing search in Sql Server 2005 to use the darn thesaurus file I was writing, I happened upon &lt;A href="http://groups.google.com/group/microsoft.public.sqlserver.fulltext/browse_thread/thread/1560031044204408/36ef0c301150aa4a?lnk=gst&amp;amp;q=thesaurus&amp;amp;rnum=2#36ef0c301150aa4a"&gt;this newsgroup post&lt;/A&gt; in which the guy was having the &lt;EM&gt;exact&lt;/EM&gt; same problem as me.&amp;nbsp; In essence, Sql Server expects a unicode file with byte order marks written to it, which TextPad doesn't do by default.&amp;nbsp; Changing TextPad to save as unicode with byte order marks solves the problem.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I'm hoping the lots of superfluous and gratuitous keywords added to this post (like "Sql Server 2005", and "full-text search" and "thesaurus" "not working") will mean that someone else out there is saved the trouble I had.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=13804" width="1" height="1"&gt;</description></item><item><title>HOW TO: Link Indexing Service to Sql Server 2005 and query using OPENQUERY</title><link>http://blogs.geekdojo.net/richard/archive/2006/08/29/13525.aspx</link><pubDate>Tue, 29 Aug 2006 12:08:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:13525</guid><dc:creator>richard</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/13525.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=13525</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/13525.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;This was enough of a PITA that I'm going to blog it in hopes of keeping someone else from feeling my pain.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;The goal: in Sql Server 2005, add a linked server that is the local indexing service&amp;nbsp;[edit to add: I don't think it's possible to&amp;nbsp;connect to a remote server]&amp;nbsp;and then query using the &lt;FONT color=#000080&gt;OPENQUERY&lt;/FONT&gt; function.&amp;nbsp; It's actually pretty simple, but I was getting frustrated, so here we go.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana&gt;&lt;FONT size=2&gt;In Management Studio, expand Server Objects--&amp;gt;Linked Servers.&amp;nbsp; Right click and select "new linked server".&amp;nbsp; It might also be handy to bring up the Indexing Service's snap-in control panel to reference some info.&amp;nbsp; It's on the Computer Management console under Administrative Tools, or just go Start--&amp;gt;Run--&amp;gt; &lt;STRONG&gt;ciadv.msc&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;In the dialog that comes up, fill in "Linked Server" textbox with any arbitrary name you want.&amp;nbsp; &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;Make sure the "Other data source" radio button is checked.&amp;nbsp; &lt;/FONT&gt;
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;Select "Microsoft&amp;nbsp;OLE DB Provider for Indexing Service" (I just tab to the drop-down and hit the END key 'cause it's the last entry on the provider list).&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Verdana size=2&gt;Fill in the "Data Source" field with the name of the catalog from your index server.&amp;nbsp; Don't know the name? Look at the list in the indexer server control panel you opened.&amp;nbsp;&lt;/FONT&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;OK, and you're done adding the linked server.&amp;nbsp;&amp;nbsp;Querying from the index is not what I was used to and finding information required a lot of Google-Fu.&amp;nbsp; Here's a simple query from a project of mine where the "Linked Server" name is 'KnowledgeDocs'.&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;SELECT&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;*&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;OpenQuery&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;KnowledgeDocs&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'Select Directory, FileName, Size FROM SCOPE()'&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT face=Verdana color=#000000&gt;You'll notice a thing called Scope() is being used as the 'table' here.&amp;nbsp; Scope provides functionality&amp;nbsp;as a table, but also for further&amp;nbsp;isolating which directory in your&amp;nbsp;catalog&amp;nbsp;you want to hit with the query.&amp;nbsp; Here's a slightly more complex query illustrating that:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT face=Verdana color=#000000&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;SELECT&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Arial&gt;&lt;FONT face="Courier New"&gt;&lt;FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;* &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;OpenQuery&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;KnowledgeDocs&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'Select Attrib,Directory, FileName, Size FROM SCOPE(''DEEP TRAVERSAL OF "C:\Somewhere\1.1\Documents"'')'&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;)&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#800000 size=2&gt;&lt;FONT face=Verdana color=#000000&gt;You can see I've added some stuff inside the SCOPE function.&amp;nbsp; Well, just so it's clear, let me spell out what's in there.&amp;nbsp; First, because we're passing this query through as text, and since the SCOPE function wants a single quote, we're first escaping our single quote by doubling it.&amp;nbsp; Then come the string-within-a-string representing the clause/parameters telling the scope function to go through every sub-folder of a particular search location. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;There are a lot of differences in the SQL language implementation for Indexing Service.&amp;nbsp; Here's the MSDN link (was hard for me to find!) on the query syntax:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#800000 size=2&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/indexsrv/html/ixrefqls_3wj7.asp?frame=true"&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/indexsrv/html/ixrefqls_3wj7.asp?frame=true&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#800000&gt;&lt;/FONT&gt;&lt;FONT color=#800000&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Here's an example of a slightly more complicated query:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;FONT color=#800000&gt;&lt;FONT color=#0000ff size=2&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;SELECT&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;*&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;OpenQuery&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt;KnowledgeDocs&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;,&lt;/FONT&gt;&lt;FONT color=#000000 size=2&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" color=#ff0000 size=2&gt;'&lt;BR&gt;SET RANKMETHOD DICE COEFFICIENT&lt;BR&gt;SELECT Rank, Directory, FileName, Size &lt;BR&gt;&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT&gt;&lt;FONT color=#ff0000 size=2&gt;FROM SCOPE(&lt;BR&gt;''DEEP TRAVERSAL OF "C:\Somewhere\1.1\Documents"'',&lt;BR&gt;''SHALLOW TRAVERSAL OF "C:\SomewhereElse\Documents"'')&lt;BR&gt;WHERE CONTAINS(''CME'')&lt;BR&gt;AND CONTAINS('' "gateway" NEAR() "network" '')&lt;BR&gt;AND CONTAINS('' FORMSOF(INFLECTIONAL, "connect") '')AND FREETEXT(''install network gateway'')&lt;BR&gt;AND ( FileName LIKE ''%.htm'' OR FileName LIKE ''%.doc'')&lt;BR&gt;ORDER BY RANK DESC'&lt;/FONT&gt;&lt;FONT color=#800000 size=2&gt;)&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;I hope his has been helpful...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana color=#000000 size=2&gt;Richard&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;&lt;FONT&gt;&lt;FONT color=#800000 size=2&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=13525" width="1" height="1"&gt;</description></item><item><title>You down with FTP?</title><link>http://blogs.geekdojo.net/richard/archive/2006/03/22/10373.aspx</link><pubDate>Thu, 23 Mar 2006 02:26:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:10373</guid><dc:creator>richard</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/10373.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=10373</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/10373.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Just want to save this article on FTP stuff for .NET 2.0.&amp;nbsp; Had a need in the past and may again!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.codeproject.com/vb/net/FtpClient.asp"&gt;&lt;FONT face=Verdana size=2&gt;http://www.codeproject.com/vb/net/FtpClient.asp&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=10373" width="1" height="1"&gt;</description></item><item><title>SqlDbType to SqlType mapping</title><link>http://blogs.geekdojo.net/richard/archive/2006/02/11/9788.aspx</link><pubDate>Sun, 12 Feb 2006 03:59:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:9788</guid><dc:creator>richard</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/9788.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=9788</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/9788.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Just want to save this mapping URL on MSDN of SqlDbType to SqlType (the 'native' sql types you should use in Sql CLR code), since I expect to be doing some of that, shortly!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlTypes.asp"&gt;&lt;FONT face=Verdana size=2&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemDataSqlTypes.asp&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;[ETA: duh, you actually have to add the link]&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=9788" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richard/archive/category/7.aspx">.NET</category><category domain="http://blogs.geekdojo.net/richard/archive/category/1034.aspx">Sql Server 2005</category></item><item><title>Link: C# Anonymous methods are not closures</title><link>http://blogs.geekdojo.net/richard/archive/2005/11/03/9398.aspx</link><pubDate>Fri, 04 Nov 2005 04:46:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:9398</guid><dc:creator>richard</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/9398.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=9398</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/9398.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Just linking to an interesting discussion (vis a vis the comments) of closures and C# 2.0:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/abhinaba/archive/2005/10/18/482180.aspx"&gt;&lt;FONT face=Verdana size=2&gt;http://blogs.msdn.com/abhinaba/archive/2005/10/18/482180.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=9398" width="1" height="1"&gt;</description></item><item><title>Amusing comic based on Spam subject lines</title><link>http://blogs.geekdojo.net/richard/archive/2005/10/05/9284.aspx</link><pubDate>Wed, 05 Oct 2005 11:21:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:9284</guid><dc:creator>richard</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/9284.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=9284</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/9284.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I thought &lt;/FONT&gt;&lt;A href="http://spamusement.com/"&gt;&lt;FONT face=Verdana size=2&gt;this&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Verdana size=2&gt;&amp;nbsp;was a good way to get some of your life back from spam!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=9284" width="1" height="1"&gt;</description></item><item><title>Microsoft Zealots invade bookstore?</title><link>http://blogs.geekdojo.net/richard/archive/2005/05/31/8434.aspx</link><pubDate>Tue, 31 May 2005 14:57:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:8434</guid><dc:creator>richard</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/8434.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=8434</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/8434.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Recently spotted... &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.aleth.org/BillGBuysBookstore.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=8434" width="1" height="1"&gt;</description></item><item><title>Application Updater Blocks 2.0 - Unusable?  Please prove me wrong!</title><link>http://blogs.geekdojo.net/richard/archive/2005/04/06/7603.aspx</link><pubDate>Wed, 06 Apr 2005 17:42:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:7603</guid><dc:creator>richard</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/7603.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=7603</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/7603.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I would not post such a thing as this&amp;nbsp;if I had not spent a LOT of time looking at it.&amp;nbsp; But I have, and the new Application Updater Block v2.0 has been neither easy to implement nor reliable in even toy problems for me.&amp;nbsp; I'm extremely disappointed.&amp;nbsp; I understand that I probably don't understand properly how to use it.&amp;nbsp; But I also know I'm from from an idiot and walking through the step-by-step instructions and QuickStarts &lt;EM&gt;multiple times&lt;/EM&gt;&amp;nbsp;should have made it relatively easy to implement an out-of-the box auto-update.&amp;nbsp; Not the case.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I've googled. I've followed the help instructions. I've modeled the QuickStarts.&amp;nbsp; I've Uninstalled and reinstalled.&amp;nbsp; Recompiled the AppBlocks and Ent. Library using some of the various different build&amp;nbsp;configs (why does Release compile but ReleaseFinal does not??).&amp;nbsp; Regardless of these efforts I have had to step into code everywhere just to figure out that my trivial updates weren't downloaded by the BitsDownloader or why my error events weren't firing when Bits&amp;nbsp;encountered a COM exception etc. etc.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;I know a lot of brilliant people worked on this thing, and I know it's highly configurable and extensible (or is supposed to be).&amp;nbsp; But like with most generic purpose, complex things, it's NOT easy to use and does require specialized knowledge of its inner workings in even the most basic case of true end-to-end auto updates.&amp;nbsp; If anyone wants to step up and point me to (or write!) a no-fail guide to a simple vanilla implementation of AUB2.0 with a Windows app&amp;nbsp;I'll be grateful.&amp;nbsp; But I won't believe it's simple or easy when I have, with great humilty and focus tried to implement auto update with it several times and faced non-trivial roadblocks at each one.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=7603" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richard/archive/category/7.aspx">.NET</category><category domain="http://blogs.geekdojo.net/richard/archive/category/8.aspx">C#</category></item><item><title>NUnit test a WinForm without the fuss</title><link>http://blogs.geekdojo.net/richard/archive/2005/03/23/7520.aspx</link><pubDate>Wed, 23 Mar 2005 16:42:00 GMT</pubDate><guid isPermaLink="false">8c778905-0e18-4c86-9fd6-6e26bc083633:7520</guid><dc:creator>richard</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.geekdojo.net/richard/comments/7520.aspx</comments><wfw:commentRss>http://blogs.geekdojo.net/richard/commentrss.aspx?PostID=7520</wfw:commentRss><wfw:comment>http://blogs.geekdojo.net/rsscomments/7520.aspx</wfw:comment><description>&lt;P&gt;&lt;FONT face=Verdana size=2&gt;VS.NET is a funny thing, it &lt;EM&gt;won't&lt;/EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;let you reference an .exe and yet csc.exe &lt;EM&gt;will&lt;/EM&gt;.&amp;nbsp; That's a bit of a pain when you want to reference, say, a WinForm for unit testing purposes.&amp;nbsp; Sure, you can create a separate assembly project for the entry point leaving your forms project as a class library, but I have enough projects crowded in my solution as it is - plus it just feels wrong to me.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;So I put this pre and post build event in my WinForms project and set my unit test project to be dependant on my WinForms projects build and &lt;EM&gt;voila!&lt;/EM&gt; I get a reference assembly that VS.NET can live with via a hard link.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Pre build event:&lt;BR&gt;&lt;/FONT&gt;erase /q $(TargetFileName).dll&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Post build event:&lt;/FONT&gt;&lt;BR&gt;fsutil hardlink create $(TargetFileName).dll $(TargetFileName)&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Verdana size=2&gt;Then I just reference the resulting .dll as a normal reference and everything just works.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.geekdojo.net/aggbug.aspx?PostID=7520" width="1" height="1"&gt;</description><category domain="http://blogs.geekdojo.net/richard/archive/category/7.aspx">.NET</category><category domain="http://blogs.geekdojo.net/richard/archive/category/8.aspx">C#</category></item></channel></rss>