<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://lunarmedia.com/utility/FeedStylesheets/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>Lunarmedia Blog</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/default.aspx</link><description>Personal blog by Anders Vindberg filled with dissimilar things ranging from molecular cooking sessions to innovation theories and web development combined with interesting daily thoughts all served with a dried academic tongue. Some of it may be indecipherable as my original tongue is Danish (no excuse) but do try and keep me entertained by commenting my tangled words.</description><dc:language>en</dc:language><generator>CommunityServer 2007 (Build: 20416.853)</generator><item><title>Web Deploy: (401) Unauthorized</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2012/01/17/web-deploy-401-unauthorized.aspx</link><pubDate>Tue, 17 Jan 2012 12:20:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124429</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://lunarmedia.com/blogs/lunarmedia_blog/rsscomments.aspx?PostID=124429</wfw:commentRss><comments>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2012/01/17/web-deploy-401-unauthorized.aspx#comments</comments><description>&lt;p&gt;If you are getting the 401 Unauthorized error from Visual Studio when trying to use Web Deploy, then (because of a Bug in Web Deploy (also version 2)) add this to your regedit:&lt;/p&gt;&lt;p&gt;at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System &lt;/p&gt;&lt;p&gt;add DWORD: LocalAccountTokenFilterPolicy with value: 1.&lt;/p&gt;&lt;p&gt;Now you can use a windows user that is a member of your admin group (not the native admin) to deploy your content! &lt;br&gt;&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124429" width="1" height="1"&gt;</description></item><item><title>IIS6: The service did not respond to the start or control request in a timely fashion</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2011/11/25/iis6-the-service-did-not-respond-to-the-start-or-control-request-in-a-timely-fashion.aspx</link><pubDate>Fri, 25 Nov 2011 19:14:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124419</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://lunarmedia.com/blogs/lunarmedia_blog/rsscomments.aspx?PostID=124419</wfw:commentRss><comments>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2011/11/25/iis6-the-service-did-not-respond-to-the-start-or-control-request-in-a-timely-fashion.aspx#comments</comments><description>
&lt;p&gt;After a Windows Update on our Win2003 server, we suddently received this message when trying to stop or start an app pool or website.&lt;/p&gt;
&lt;p&gt;For our particular situation I found the answer on &lt;a href="http://www.jesswatts.com/it/iis-the-service-did-not-respond-to-the-start-or-control-request-in-a-timely-fashion" mce_href="http://www.jesswatts.com/it/iis-the-service-did-not-respond-to-the-start-or-control-request-in-a-timely-fashion"&gt;JessWatts.com&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;"&lt;i&gt;It is possible that a shared dll that IIS 6 relies on has become unregistered.&lt;br&gt;
Try running the following command: regsvr32 qmgr.dll&lt;br&gt;
Then reboot the server and start the failed websites.&lt;/i&gt;" &lt;/p&gt;
&lt;p&gt;Thanks Jess! &lt;br&gt;&lt;/p&gt;
&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124419" width="1" height="1"&gt;</description></item><item><title>Solr delete/clear index</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2011/10/19/solr-delete-clear-index.aspx</link><pubDate>Wed, 19 Oct 2011 06:13:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124418</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;To delete/clear the solr index.&lt;br&gt;&lt;br&gt;Simply run both of these in the browser (change the "solr" name and port to your specific solr instance name if the default wasn't used):&lt;br&gt;&lt;br&gt;1. http://localhost:8080/solr/update?stream.body=%3Cdelete%3E%3Cquery%3E*:*%3C/query%3E%3C/delete%3E&lt;br&gt;2. http://localhost:8080/solr/update?stream.body=%3Ccommit/%3E&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124418" width="1" height="1"&gt;</description></item><item><title>Performance with Entity Framework</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2011/09/23/performance-with-entity-framework.aspx</link><pubDate>Thu, 22 Sep 2011 20:22:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124417</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>
&lt;p&gt;&amp;nbsp;Here are some links to great resources if you are looking to build high-performance enterprise website solutions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.asp.net/entity-framework/tutorials/maximizing-performance-with-the-entity-framework-in-an-asp-net-web-application" mce_href="http://www.asp.net/entity-framework/tutorials/maximizing-performance-with-the-entity-framework-in-an-asp-net-web-application"&gt;http://www.asp.net/entity-framework/tutorials/maximizing-performance-with-the-entity-framework-in-an-asp-net-web-application&amp;nbsp;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blogs.msdn.com/b/adonet/archive/2011/01/27/using-dbcontext-in-ef-feature-ctp5-part-1-introduction-and-model.aspx" mce_href="http://blogs.msdn.com/b/adonet/archive/2011/01/27/using-dbcontext-in-ef-feature-ctp5-part-1-introduction-and-model.aspx"&gt;http://blogs.msdn.com/b/adonet/archive/2011/01/27/using-dbcontext-in-ef-feature-ctp5-part-1-introduction-and-model.aspx&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Microsoft is moving fast these days. The entity framework is getting more functionality and structure as it progresses. It seems to be implementing several best practice patterns such as repository and unit of work patterns among others.&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124417" width="1" height="1"&gt;</description></item><item><title>Sql Profiler - Analyzing number of database calls</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2011/01/20/sql-profiler-analyzing-number-of-database-calls.aspx</link><pubDate>Thu, 20 Jan 2011 13:33:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124416</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Is your pageload taking more than 0.2 seconds! its time to investigate how many database roundtrips your webapplication is making. If you haven't got Sql Profiler (with MS Sql Server) go download AnjLab Sql Profiler its free.
&lt;/p&gt;&lt;p&gt;
To identify database roundtrips from an application, Setup the following events:
&lt;/p&gt;&lt;p&gt;
RPC:Completed
SQL:BatchCompleted
&lt;/p&gt;&lt;p&gt;
And this filter:
TextData Not Like exec sp_reset_connection%
&lt;/p&gt;&lt;p&gt;
Source: Jeremy Jameson - http://blogs.msdn.com/b/jjameson/archive/2010/09/03/analyzing-database-roundtrips-with-sql-server-profiler.aspx
&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124416" width="1" height="1"&gt;</description></item><item><title>IIS Application Pool Queue Length Settings</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/12/06/iis-application-pool-queue-lenght-settings.aspx</link><pubDate>Mon, 06 Dec 2010 13:16:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124415</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;This is hard to find information:
&lt;/p&gt;&lt;p&gt;The default limit for an application pool is 4000 requests. On a moderately sized server with a few application pools configured, this might be a good value. However, on a server with multiple CPUs and lots of RAM, this value might be too low. On a server with limited resources or many application pools configured, this value might be too high. Here you might want to use a formula of Memory Size in Megabytes x Number of CPUs x 10 divided by Number of Configured Application Pools to determine what the size of the average request queue should be. This is meant to be a guideline to give you a starting point for consideration and not an absolute rule. For example, on a server with two CPUs, 1024 MB of RAM, and twenty configured application pools, the size of the average request queue limit would be around 1,000 requests. You might have some application pools configured with request queue limits of 750 and others with request queue limits of 1,250. However, if the same server had only one configured application pool, you probably wouldn’t configure a request queue limit of 10,000. 
&lt;/p&gt;
&lt;p&gt;
Source: http://forums.asp.net/p/623323/623323.aspx (Matthew, Microsoft).&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124415" width="1" height="1"&gt;</description></item><item><title>Dealing with TC/CS DateFormats</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/11/02/dealing-with-tc-cs-dateformats.aspx</link><pubDate>Tue, 02 Nov 2010 15:53:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124414</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;
Defining a specific date format in TC (and CS (Community Server)) can be tricky. An example could be: "30 september, 2003" or "01-01-2010". &lt;br&gt;&lt;br&gt;First you need to know that all the users you may have registered in your database will not be affected by changes made to the default date format defined in the controlpanel. They each need to select a new date format in their profile settings to get a new date format.&lt;br&gt;&lt;br&gt;Working with a new TC website you should define the preferred date format before any users are registered:&lt;br&gt;
&lt;/p&gt;&lt;ol&gt;
&lt;li&gt;Search for "Utility_DateFormatDropDownList_F1" in your language files located in the "languages" folder.&lt;/li&gt;
&lt;li&gt;Edit one or more of the defined date formats if your preferred format is not already defined. Reset the application pool (iisreset).&lt;br&gt;&lt;/li&gt;
&lt;li&gt;Goto yourwebsite.com/controlpanel/Settings/Setup.aspx and select the preferred date format. Press "Save".&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;From this time forward new users will be preselected to use the date format selected. They can still at any time goto their profile settings to select a different format from the dropdown list unless you simply remove this from the template :).&lt;/p&gt;
&lt;p&gt;The defaultDate defined in the web.config file can be disregarded.&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124414" width="1" height="1"&gt;</description></item><item><title>Scandinavian letters (ÆØÅ) in javascript formatting!</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/09/09/scandinavian-letters-198-216-197-in-javascript-formatting.aspx</link><pubDate>Thu, 09 Sep 2010 07:53:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124413</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;For future reference I am writing this post: ÆØÅ in JavaScript - simply save .js file as UTF-8 formatting! On how to save in UTF-8 encoding in Visual Studio 2010 see this answer: &lt;a href="http://stackoverflow.com/questions/2268037/visual-studio-2010-and-utf-8-encoding/4955304#4955304"&gt;UTF-8 Encoding&lt;/a&gt; at Stackoverflow. &lt;/p&gt;
&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124413" width="1" height="1"&gt;</description></item><item><title>TC 5.5 Localization</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/08/12/tc-5-5-localization.aspx</link><pubDate>Thu, 12 Aug 2010 12:33:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124316</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Everything in Telligent Community is becoming increasingly complex. A simple feature as localization has once again been filtered into the database. Its important to know if you are translating TC into a none-english language that profile field names and profile widget headlines are located in controlpanel (Membership) and not in the language files where they belong! &lt;/p&gt;&lt;p&gt;UPDATE: The widget headlines can be defined in codebehind and thus reference the language files. The profile fields can also reference the language file if defined in the theme.config file! Adding them adhoc is still an issue. &lt;br&gt;&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124316" width="1" height="1"&gt;</description></item><item><title>CSControl:Pager Template Styling</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/07/28/cscontrol-pager-template-styling.aspx</link><pubDate>Wed, 28 Jul 2010 07:44:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:124315</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Styling the pager control in Community Server always escapes me so here is an example:&lt;/p&gt;&lt;p&gt;&lt;font face="courier new,courier"&gt;&amp;lt;CSControl:Pager id="pager" runat="Server" Tag="div" style='text-align: center;'&amp;gt;&lt;br&gt;&amp;lt;FirstLinkTemplate&amp;gt;&lt;br&gt;&amp;nbsp;
 &amp;lt;CSControl:CSLinkData LinkTo="Link" LinkCssClass="TextButton" 
runat="server"&amp;gt;&amp;lt;ContentTemplate&amp;gt;&amp;lt;span&amp;gt;&amp;lt;span&amp;gt;Newest&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/ContentTemplate&amp;gt;&amp;lt;/CSControl:CSLinkData&amp;gt;&lt;br&gt;&amp;lt;/FirstLinkTemplate&amp;gt;&lt;br&gt;&amp;lt;PreviousLinkTemplate&amp;gt;&lt;br&gt;&amp;nbsp;
 &amp;lt;CSControl:CSLinkData LinkTo="Link" LinkCssClass="TextButton" 
runat="server"&amp;gt;&amp;lt;ContentTemplate&amp;gt;&amp;lt;span&amp;gt;&amp;lt;span&amp;gt;Newer&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/ContentTemplate&amp;gt;&amp;lt;/CSControl:CSLinkData&amp;gt;&lt;br&gt;&amp;lt;/PreviousLinkTemplate&amp;gt;&lt;br&gt;&amp;lt;PageLinkTemplate&amp;gt;&lt;br&gt;&amp;nbsp;
 &amp;lt;CSControl:CSLinkData LinkTo="Link" Property="Text" 
Text="&amp;lt;span&amp;gt;&amp;lt;span&amp;gt;{0}&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;" 
LinkCssClass="TextButton" runat="server" /&amp;gt;&lt;br&gt;&amp;lt;/PageLinkTemplate&amp;gt;&lt;br&gt;&amp;lt;CurrentPageLinkTemplate&amp;gt;&lt;br&gt;&amp;nbsp;
 &amp;lt;CSControl:CSLinkData Tag="Span" CssClass="TextButtonDisabled" 
Property="Text" 
Text="&amp;lt;span&amp;gt;&amp;lt;span&amp;gt;{0}&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;" 
runat="server" /&amp;gt;&lt;br&gt;&amp;lt;/CurrentPageLinkTemplate&amp;gt;&lt;br&gt;&amp;lt;SeparatorTemplate&amp;gt;&amp;lt;/SeparatorTemplate&amp;gt;&lt;br&gt;&amp;lt;NextLinkTemplate&amp;gt;&lt;br&gt;&amp;nbsp;
 &amp;lt;CSControl:CSLinkData LinkTo="Link" LinkCssClass="TextButton" 
runat="server"&amp;gt;&amp;lt;ContentTemplate&amp;gt;&amp;lt;span&amp;gt;&amp;lt;span&amp;gt;Older&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/ContentTemplate&amp;gt;&amp;lt;/CSControl:CSLinkData&amp;gt;&lt;br&gt;&amp;lt;/NextLinkTemplate&amp;gt;&lt;br&gt;&amp;lt;LastLinkTemplate&amp;gt;&lt;br&gt;&amp;nbsp;
 &amp;lt;CSControl:CSLinkData LinkTo="Link" LinkCssClass="TextButton" 
runat="server"&amp;gt;&amp;lt;ContentTemplate&amp;gt;&amp;lt;span&amp;gt;&amp;lt;span&amp;gt;Oldest&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/ContentTemplate&amp;gt;&amp;lt;/CSControl:CSLinkData&amp;gt;&lt;br&gt;&amp;lt;/LastLinkTemplate&amp;gt;&lt;br&gt;&amp;lt;/CSControl:Pager&amp;gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Source: &lt;a href="http://getben.com/archive/2007/01/30/introduction-to-chameleon-questions-and-answers.aspx" mce_href="http://getben.com/archive/2007/01/30/introduction-to-chameleon-questions-and-answers.aspx"&gt;http://getben.com/archive/2007/01/30/introduction-to-chameleon-questions-and-answers.aspx &lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=124315" width="1" height="1"&gt;</description></item><item><title>Visual Studio (VS) 2010 Build Configuration dropdown</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/04/22/visual-studio-vs-2010-build-configuration-dropdown.aspx</link><pubDate>Thu, 22 Apr 2010 14:41:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:123873</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://lunarmedia.com/blogs/lunarmedia_blog/rsscomments.aspx?PostID=123873</wfw:commentRss><comments>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/04/22/visual-studio-vs-2010-build-configuration-dropdown.aspx#comments</comments><description>&lt;p&gt;If you happen to be missing the Build configuration dropdown menu from your toolbar in Visual Studio 2010 and can't find it in the Build toolbar here is how you add it back in:&lt;/p&gt;&lt;p&gt;Tools -&amp;gt; Customize -&amp;gt; Commands (tab). Select "Toolbar:" and then select "Build" from the dropdown. &lt;/p&gt;&lt;p&gt;Click on "Add Command", select "Build" in Categories and find "Solution Configurations" (at the bottom). Click "Ok" and it is back in the "Build" toolbar!&lt;br&gt;&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=123873" width="1" height="1"&gt;</description></item><item><title>Entity Framework 4.0 RC: Cannot insert the value NULL into column '*_Id', table 'Paragraphs'; column does not allow nulls. INSERT fails. The statement has been terminated.
</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/04/08/entity-framework-4-0-rc-cannot-insert-the-value-null-into-column-id-table-paragraphs-column-does-not-allow-nulls-insert-fails-the-statement-has-been-terminated.aspx</link><pubDate>Thu, 08 Apr 2010 12:34:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:123836</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://lunarmedia.com/blogs/lunarmedia_blog/rsscomments.aspx?PostID=123836</wfw:commentRss><comments>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/04/08/entity-framework-4-0-rc-cannot-insert-the-value-null-into-column-id-table-paragraphs-column-does-not-allow-nulls-insert-fails-the-statement-has-been-terminated.aspx#comments</comments><description>&lt;p&gt;Entity Framework 4.0 RC bug. Usually after an "update model from database" I encounter this error message:  Cannot insert the value NULL into column '*_Id', table 'column does not allow nulls. INSERT fails. The statement has been terminated.&lt;/p&gt;&lt;p&gt;To fix the association between the many-to-one relationship (in my case Paragraphs to Translation), you need to edit the .edmx model file and remove StoreGeneratedPattern="Identity" from the Paragraphs node.&lt;/p&gt;&lt;p&gt;See more here: &lt;a href="http://stackoverflow.com/questions/2243618/how-do-you-insert-or-update-many-to-many-tables-in-net-entity-framework/2339834#2339834" mce_href="http://stackoverflow.com/questions/2243618/how-do-you-insert-or-update-many-to-many-tables-in-net-entity-framework/2339834#2339834"&gt;http://stackoverflow.com/questions/2243618/how-do-you-insert-or-update-many-to-many-tables-in-net-entity-framework/2339834#2339834 &lt;/a&gt;&lt;br&gt;&lt;/p&gt;&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=123836" width="1" height="1"&gt;</description></item><item><title>LINQ to Entities - Common queries (.Net 4.0)</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/03/13/linq-to-entities-common-queries-net-4-0.aspx</link><pubDate>Sat, 13 Mar 2010 09:08:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:123805</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://lunarmedia.com/blogs/lunarmedia_blog/rsscomments.aspx?PostID=123805</wfw:commentRss><comments>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/03/13/linq-to-entities-common-queries-net-4-0.aspx#comments</comments><description>
&lt;h3&gt;T-Sql "WHERE IN":&lt;/h3&gt;&lt;p&gt;&lt;font face="arial"&gt;&lt;font color="#000000"&gt;Sql:&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff" face="Courier New"&gt;SELECT * FROM People &lt;br&gt;WHERE Firstname IN ('Peter', 'Steve', 'John', 'Bruno')&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="arial"&gt;&lt;font color="#000000"&gt;LINQ:&lt;/font&gt;&lt;/font&gt;&lt;br&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff"&gt;&lt;font face="Courier New"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt; names = &lt;font color="#0000ff"&gt;new&lt;/font&gt; &lt;font color="#0000ff"&gt;string&lt;/font&gt;[] { &lt;font color="#a31515"&gt;"Peter"&lt;/font&gt;, &lt;font color="#a31515"&gt;"Steve"&lt;/font&gt;, &lt;font color="#a31515"&gt;"John"&lt;/font&gt;, &lt;font color="#a31515"&gt;"Bruno"&lt;/font&gt; };&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font color="#0000ff"&gt;&lt;font face="Courier New"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt; matches = &lt;font color="#0000ff"&gt;from&lt;/font&gt; person &lt;font color="#0000ff"&gt;in&lt;/font&gt; people &lt;br&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;where&lt;/font&gt; names.Contains(person.Firstname) &lt;br&gt;&lt;/font&gt;&lt;font size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;select&lt;/font&gt; person;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=123805" width="1" height="1"&gt;</description></item><item><title>Encrypting connectionstrings.config in IIS 6.0</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2010/02/09/encrypting-connectionstring-config-in-iis-6-0.aspx</link><pubDate>Tue, 09 Feb 2010 10:09:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:123804</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Simply call these two commands in cmd prompt:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;C:\WINDOWS\microsoft.net\Framework64\v2.0.50727\aspnet_regiis.exe -pef "connectionStrings" C:\MyWebsiteFolder&lt;/li&gt;
&lt;li&gt;C:\WINDOWS\microsoft.net\Framework64\v2.0.50727\aspnet_regiis -pa "NetFrameworkConfigurationKey" "Network Service"&lt;br&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;If you still get a: "&lt;i&gt;Failed
 to decrypt using provider 'RsaProtectedConfigurationProvider'. Error 
message from the provider: The RSA key container could not be opened.&lt;/i&gt;" Then call the second command again but replace "Network Service" with "ASPNET".&lt;/p&gt;
&lt;p&gt;Source: MS Patterns &amp;amp; Practices: &lt;a href="http://msdn.microsoft.com/en-us/library/ms998283.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms998283.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms998283.aspx&lt;/a&gt;&lt;br&gt;&lt;/p&gt;
&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=123804" width="1" height="1"&gt;</description></item><item><title>T-SQL Dynamic Sorting and Order By</title><link>http://lunarmedia.com/blogs/lunarmedia_blog/archive/2009/07/15/t-sql-dynamic-sorting-and-order-by.aspx</link><pubDate>Wed, 15 Jul 2009 09:14:00 GMT</pubDate><guid isPermaLink="false">8e740287-7179-42ca-83bf-5c4af18dab29:123693</guid><dc:creator>Anders Vindberg</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Using the CASE expression its possible to do efficient sorting and ordering by different parameters in one query. Here is an example from &lt;a href="http://gregbeech.com/blogs/tech/archive/2008/07/21/dynamic-sorting-and-paging-in-sql-server-with-the-case-expression.aspx" mce_href="http://gregbeech.com/blogs/tech/archive/2008/07/21/dynamic-sorting-and-paging-in-sql-server-with-the-case-expression.aspx"&gt;Greg Beech's Tech Blog&lt;/a&gt; which also includes paging:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre&gt;DECLARE @SortType TINYINT, @SortAscending BIT, @FirstRow INT, @MaxRows INT;&lt;br&gt;SELECT @SortType = 2, @SortAscending = 0, @FirstRow = 10, @MaxRows = 10;&lt;br&gt;&lt;br&gt;WITH FoundCustomers AS&lt;br&gt;(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SELECT&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ROW_NUMBER() OVER&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ORDER BY &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CASE WHEN @SortType = 0 AND @SortAscending = 1 THEN c.ContactName END ASC&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,CASE WHEN @SortType = 0 AND @SortAscending = 0 THEN c.ContactName END DESC&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,CASE WHEN @SortType = 1 AND @SortAscending = 1 THEN c.CompanyName END ASC&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,CASE WHEN @SortType = 1 AND @SortAscending = 0 THEN c.CompanyName END DESC&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,CASE WHEN @SortType = 2 AND @SortAscending = 1 THEN c.Country END ASC&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,CASE WHEN @SortType = 2 AND @SortAscending = 0 THEN c.Country END DESC&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) AS RowNumber&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,c.*&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FROM&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dbo.Customers c&lt;br&gt;)&lt;br&gt;SELECT&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc.*&lt;br&gt;FROM&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FoundCustomers fc&lt;br&gt;WHERE&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc.RowNumber BETWEEN @FirstRow AND @FirstRow + @MaxRows - 1&lt;br&gt;ORDER BY&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc.RowNumber;&lt;/pre&gt;
&lt;img src="http://lunarmedia.com/aggbug.aspx?PostID=123693" width="1" height="1"&gt;</description></item></channel></rss>
