<feed 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/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
    <title>Development 4.0</title>
    <link rel="self" type="application/xml" href="http://williamkent.net/Atom.aspx" />
    <subtitle type="html">Musings &amp;  Reflections</subtitle>
    <id>http://williamkent.net/Default.aspx</id>
    <author>
        <name>William Kent</name>
        <uri>http://williamkent.net/Default.aspx</uri>
    </author>
    <generator uri="http://subtextproject.com" version="Subtext Version 1.9.5.176">Subtext</generator>
    <updated>2012-06-17T20:10:48Z</updated>
    <entry>
        <title>Network problems with Windows 8rc on Vmware</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2012/06/17/network-problems-with-windows-8rc-on-vmware.aspx" />
        <id>http://williamkent.net/archive/2012/06/17/network-problems-with-windows-8rc-on-vmware.aspx</id>
        <published>2012-06-17T20:10:48-06:00:00</published>
        <updated>2012-06-17T20:10:48Z</updated>
        <content type="html">&lt;p&gt;If you are having difficulties attempting to get networking up and running on Windows 8 running under VMWare workstation here is a tip that might fix it for you. It did for me.
&lt;/p&gt;&lt;p&gt;Inspect the .vmx file for your virtual machine, and if this line is not present just add it to the vmx file:
&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;strong&gt;ethernet0.virtualDev = "e1000"&lt;/strong&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://williamkent.net/aggbug/76.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Windows Azure Tools: Failed to initialize the Development Storage service.</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2011/03/12/windows-azure-tools-failed-to-initialize-the-development-storage-service.aspx" />
        <id>http://williamkent.net/archive/2011/03/12/windows-azure-tools-failed-to-initialize-the-development-storage-service.aspx</id>
        <published>2011-03-12T19:12:12-07:00:00</published>
        <updated>2011-03-12T19:12:12Z</updated>
        <content type="html">&lt;p&gt;Recently I setup a new laptop for developing Azure solution.    &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;The first problem is that Visual Studio 2010 must run as Administrator in order to run the local appfabric. &lt;/p&gt;  &lt;p&gt;The second problem I ran into was the following error message given when I tried to debug the solution:&lt;/p&gt;  &lt;p&gt;&lt;font color="#c0504d"&gt;Failed to create database  : A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#c0504d"&gt;One or more initialization actions failed. The development storage cannot be used without resolving these errors.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Default behaviour seems to be to look for a Sql Express database (more correctly it tries to create a database with Sql Express). This laptop had a default Sql Server 2008 server installed and for some reason the app fabric was not able to find it. &lt;/p&gt;  &lt;p&gt;Here is what I did to fix it:&lt;/p&gt;  &lt;p&gt;We need to run DsInit&lt;/p&gt;  &lt;p&gt; The easiest way to invoke DSInit is to navigate to Start/All Programs/Windows Azure SDK 1.2/ and start Wypindows Azure SDK Command Prompt.&lt;/p&gt;  &lt;p&gt;In the command line window type in dsinit /sqlinstance:    (yes leave the instance blank).&lt;/p&gt;  &lt;p&gt;If you have a specific instance name you need to connect to you can specify it. &lt;/p&gt;  &lt;p&gt;This successfully installed the appfabric required database on my default Sql Server 2008 instance. &lt;/p&gt;&lt;img src="http://williamkent.net/aggbug/74.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Programmatically accessing data from an EntityDataSource</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2011/03/03/programmatically-accessing-data-from-an-entitydatasource.aspx" />
        <id>http://williamkent.net/archive/2011/03/03/programmatically-accessing-data-from-an-entitydatasource.aspx</id>
        <published>2011-03-03T21:51:19-07:00:00</published>
        <updated>2011-03-03T21:58:35Z</updated>
        <content type="html">&lt;p&gt;&lt;font size="3"&gt;At a client I recently found myself wondering how one can access the data an EntityDataSource returns. &lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;For most applications this scenario does not come up, but I was now curious so I couldn’t just let it go.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="3"&gt;I should point out right away that the easiest way to get at the data is to hook the “Selected” event of the EntityDataSource, then you can get the data like this:&lt;/font&gt;&lt;/p&gt;&lt;pre&gt;protected void EntityDataSource1_Selected(object sender, EntityDataSourceSelectedEventArgs e)
        {
            List&amp;lt;Category&amp;gt; a = e.Results.Cast&amp;lt;Category&amp;gt;().ToList();
            string s = a[1].CategoryName;

        }&lt;/pre&gt;
&lt;p&gt;&lt;font size="3"&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;(supposing you have an entity/table named Category).&lt;/p&gt;
&lt;p&gt;Now that is all fine, but how do you trigger the data to be fetched (execute the Select command) without involving a data bound control like a GridView.&lt;/p&gt;
&lt;p&gt;The key lies in being able to cast an EntityDataSource as an IDataSource, and then executing “GetView” from that interface to return a DataSourceView, which can then be made to return a strongly typed list of entities.&lt;/p&gt;
&lt;p&gt;The use of the EntityDataSourceReader is as follows:&lt;/p&gt;&lt;pre&gt;EntityDataSourceReader&amp;lt;Category&amp;gt; dataReader = new EntityDataSourceReader&amp;lt;Category&amp;gt;(EntityDataSource1);
List&amp;lt;Category&amp;gt; list =  dataReader.GetData();&lt;/pre&gt;&lt;pre&gt; &lt;/pre&gt;
&lt;p&gt;The full code to my EntityDataSourceReader can be found in the source file linked below.&lt;/p&gt;
&lt;p&gt;(&lt;a href="http://williamkent.net/code/EntityDataSourceReader.txt" target="_blank"&gt;source&lt;/a&gt;)&lt;/p&gt;&lt;img src="http://williamkent.net/aggbug/72.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Windows 2003, IIS6 and the .Net framework 4</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2011/02/23/windows-2003-iis6-and-the-.net-framework-4.aspx" />
        <id>http://williamkent.net/archive/2011/02/23/windows-2003-iis6-and-the-.net-framework-4.aspx</id>
        <published>2011-02-23T20:31:41-07:00:00</published>
        <updated>2011-02-23T20:31:41Z</updated>
        <content type="html">&lt;p&gt;I was at a client site today and they were installing the .net Framework 4 on a Windows 2003 server (sp1). Initially I was concerned that the framework might require sp2, but that turned out not to be the case.&lt;/p&gt;
&lt;p&gt;We did experience a glitch though when we tried to navigate to the web application we were working on. We were greeted with a "The page cannot be found" 404 error.&lt;/p&gt;
&lt;p&gt;We checked the framework version, the app pool, the default documents, and all were correct. After some search I found the answer &lt;a href="http://www.chicagotribune.com/news/chi-ap-in-wisconsinproteste,0,7630113.story"&gt;here&lt;/a&gt; (courtesy of Johan Driessen).&lt;/p&gt;
&lt;p&gt;The secret is to enable the framework for iis which can be done with this magical invocation:&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; border-collapse: collapse; line-height: 13px; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;"&gt;cscript c:\windows\system32\iisext.vbs /EnFile C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;
&lt;img src="http://williamkent.net/aggbug/71.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Web.config – The entry ‘ ‘ has already been added error</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2011/02/21/web.config--the-entry---has-already-been-added.aspx" />
        <id>http://williamkent.net/archive/2011/02/21/web.config--the-entry---has-already-been-added.aspx</id>
        <published>2011-02-21T22:03:47-07:00:00</published>
        <updated>2011-02-21T22:03:47Z</updated>
        <content type="html">&lt;p&gt;So I came across this error message recently in asp.net&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Web.config – The entry ‘ ‘ has already been added error&lt;/i&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The most likely reason for this error is that a duplicate web.config&lt;br /&gt;
file exists in the parent level of the web app that gives you this error.&lt;/p&gt;
&lt;p&gt;If however that does not seem to be the problem, one thing that worked for me was to ensure that the current application and its "root" application have different app pools.&lt;/p&gt;
&lt;img src="http://williamkent.net/aggbug/70.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Quick guide to Entity Framework 2.0</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2011/02/21/quick-guide-to-entity-framework-2.0.aspx" />
        <id>http://williamkent.net/archive/2011/02/21/quick-guide-to-entity-framework-2.0.aspx</id>
        <published>2011-02-21T21:49:10-07:00:00</published>
        <updated>2011-02-21T21:53:12Z</updated>
        <content type="html">&lt;p&gt;The following code gives a rush tour of the Entity Framework 2.0.&lt;/p&gt;
&lt;p&gt;It is by no means a complete guide. The EF has a lot of power and a lot of complexity but this post is meant as a getting started right away guide.&lt;/p&gt;
&lt;p&gt;It demonstrates adding/insert records, different ways of adding records with foreign keys, querying the database, and at last deleting data.&lt;/p&gt;
&lt;p&gt;Here is the schema:&lt;/p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;br /&gt;
&lt;img src="http://williamkent.net/images/williamkent_net/schema.png" width="435" height="480" alt="schema.png" /&gt;&lt;br /&gt;
&lt;pre class="csharpcode"&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;font face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;span style="white-space: normal;"&gt;&lt;font face="Consolas, 'Courier New', Courier, monospace"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Helvetica; white-space: normal; font-size: 12px;"&gt;Instantiate the context&lt;/span&gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;span class="kwrd" style="color: #0000FF;"&gt;using&lt;/span&gt; (Test2Entities context = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; Test2Entities())&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;font face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px; white-space: normal;"&gt;Car, User, Fleetcard, Address is a table represented by an entity object generated by the Entity Framework.&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;br /&gt;Car c1 = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; Car { CarName = &lt;span class="str" style="color: #006080;"&gt;"Volvo"&lt;/span&gt; };&lt;br /&gt;context.AddToCars(c1);&lt;br /&gt;context.SaveChanges();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;User u1 = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; User { FirstName = &lt;span class="str" style="color: #006080;"&gt;"Donald"&lt;/span&gt;, LastName =&lt;br /&gt;context.AddToUsers(u1);&lt;br /&gt;context.SaveChanges();&lt;br /&gt;&lt;br /&gt;FleetCard ca1 = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; FleetCard { FleetCardName = &lt;span class="str" style="color: #006080;"&gt;"Visa"&lt;/span&gt; };&lt;br /&gt;context.AddToFleetCards(ca1);&lt;br /&gt;context.SaveChanges();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Address a1 = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; Address { Address1 = &lt;span class="str" style="color: #006080;"&gt;"Hove Blvd"&lt;/span&gt;,AddressName = &lt;span class="str" style="color: #006080;"&gt;"VIP"&lt;/span&gt; };&lt;br /&gt;context.AddToAddresses(a1);&lt;br /&gt;context.SaveChanges();&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;br /&gt;List&amp;lt;User&amp;gt; s1 = (from x &lt;span class="kwrd" style="color: #0000FF;"&gt;in&lt;/span&gt; context.Users &lt;span class="kwrd" style="color: #0000FF;"&gt;where&lt;/span&gt;&lt;br /&gt;x.UserName == &lt;span class="str" style="color: #006080;"&gt;"dduck"&lt;/span&gt; select x).ToList();&lt;br /&gt;List&amp;lt;Address&amp;gt; s2 = (from x &lt;span class="kwrd" style="color: #0000FF;"&gt;in&lt;/span&gt; context.Addresses &lt;span class="kwrd" style="color: #0000FF;"&gt;where&lt;/span&gt;&lt;br /&gt;x.AddressName == &lt;span class="str" style="color: #006080;"&gt;"VIP"&lt;/span&gt; select x).ToList();&lt;br /&gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Helvetica; font-size: 12px;"&gt;&lt;font face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px; white-space: normal;"&gt;Lets pretend we did not just create the objects, and we wish to create a UserAddress object. This table has foreign keys to a user and an address. So lets get a user and get an Address&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;font face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px; white-space: normal;"&gt;Then we can create the object and save it&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;span class="kwrd" style="color: #0000FF;"&gt;if&lt;/span&gt; (s1 != &lt;span class="kwrd" style="color: #0000FF;"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; s2 != &lt;span class="kwrd" style="color: #0000FF;"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; s1.Count &amp;gt; 0 &amp;amp;&amp;amp; s2.Count &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;UserAddress ua1 = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; UserAddress();&lt;br /&gt;ua1.UserId = s1[0].UserId;&lt;br /&gt;ua1.AddressId = s2[0].AddressId;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;context.AddToUserAddresses(ua1);&lt;br /&gt;context.SaveChanges();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;span style="font-family: Helvetica; font-size: 12px;"&gt;Now you can have a more object oriented feel to the code by setting references instead&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;font face="Helvetica" size="3"&gt;&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;UserAddress ua1 = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; UserAddress();&lt;br /&gt;ua1.User = s1[0];&lt;br /&gt;ua1.Address = s2[0];&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;br /&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;br /&gt;System.Console.WriteLine(&lt;span class="str" style="color: #006080;"&gt;"UserFleetCard&lt;/span&gt;&lt;br /&gt;&lt;span class="str" style="color: #006080;"&gt;{0}:{1}:{2}:{3}"&lt;/span&gt;, ufcc.UsersFleetCarId, ufcc.UserId, ufcc.CarId,&lt;br /&gt;ufcc.FleetCardId);&lt;br /&gt;System.Console.WriteLine(&lt;span class="str" style="color: #006080;"&gt;"Card: {0}"&lt;/span&gt;,&lt;br /&gt;ufcc.FleetCard.FleetCardName);&lt;br /&gt;System.Console.WriteLine(&lt;span class="str" style="color: #006080;"&gt;"User: {0}"&lt;/span&gt;, ufcc.User.UserName);&lt;br /&gt;System.Console.WriteLine(&lt;span class="str" style="color: #006080;"&gt;"Car: {0}"&lt;/span&gt;, ufcc.Car.CarName);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Helvetica; font-size: 12px;"&gt;&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;span style="font-family: Helvetica; font-size: 12px;"&gt;EF does not have a direct way of deleting a bunch of records:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;br /&gt;&lt;span class="kwrd" style="color: #0000FF;"&gt;public&lt;/span&gt; &lt;span class="kwrd" style="color: #0000FF;"&gt;static&lt;/span&gt; &lt;span class="kwrd" style="color: #0000FF;"&gt;void&lt;/span&gt; DeleteWithEF()&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd" style="color: #0000FF;"&gt;using&lt;/span&gt; (Test2Entities context = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; Test2Entities())&lt;br /&gt;{&lt;br /&gt;List&amp;lt;Car&amp;gt; cars = (from x &lt;span class="kwrd" style="color: #0000FF;"&gt;in&lt;/span&gt; context.Cars select x).ToList();&lt;br /&gt;cars.ForEach(x =&amp;gt; context.Cars.DeleteObject(x));&lt;br /&gt;context.SaveChanges();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;font face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;span style="white-space: normal;"&gt;&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;span style="font-family: Helvetica; font-size: 12px;"&gt;Here I demonstrate displaying a record and its  references records:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;span class="kwrd" style="color: #0000FF;"&gt;public&lt;/span&gt; &lt;span class="kwrd" style="color: #0000FF;"&gt;static&lt;/span&gt; &lt;span class="kwrd" style="color: #0000FF;"&gt;void&lt;/span&gt; DeleteAllGeneric(&lt;span class="kwrd" style="color: #0000FF;"&gt;string&lt;/span&gt; tableName)&lt;br /&gt;{&lt;br /&gt;&lt;span class="kwrd" style="color: #0000FF;"&gt;string&lt;/span&gt; sql = &lt;span class="str" style="color: #006080;"&gt;"Delete from "&lt;/span&gt; + tableName;&lt;br /&gt;&lt;span class="kwrd" style="color: #0000FF;"&gt;using&lt;/span&gt; (Test2Entities context = &lt;span class="kwrd" style="color: #0000FF;"&gt;new&lt;/span&gt; Test2Entities())&lt;br /&gt;{&lt;br /&gt;context.ExecuteStoreCommand(sql);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;font face="Helvetica" size="3"&gt;&lt;span style="font-size: 12px;"&gt;&lt;font face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;br /&gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;span style="font-family: Helvetica; font-size: 12px;"&gt;Instead you can cheat and invoke a sql command directly&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;font face="Helvetica" size="3"&gt;&lt;font face="Verdana, Arial, Helvetica, sans-serif"&gt;&lt;span style="font-family: Verdana, Arial, Helvetica, sans-serif; white-space: normal; font-size: small;"&gt;&lt;span style="font-family: Helvetica; font-size: 12px;"&gt;If you would like to  see a full example, you can download a the full source &lt;a href="http://williamkent.net/code/entity.txt"&gt;code&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: Helvetica; white-space: normal; font-size: 12px;"&gt;Some of the examples will make more sense in the context of the full source.&lt;br /&gt;Note:The code relies on an entity model being present &lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class="csharpcode" style="font-size: small; color: black; font-family: Consolas, 'Courier New', Courier, monospace; background-color: #FFFFFF;"&gt;
&lt;font face="Helvetica" size="3"&gt;&lt;br /&gt;&lt;/font&gt;
&lt;/pre&gt;
&lt;pre&gt;
&lt;br /&gt;
&lt;/pre&gt;
&lt;img src="http://williamkent.net/aggbug/69.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Sharepoint 2010 - The search request was unable to connect to the Search Service.</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2010/12/10/sharepoint-2010---the-search-request-was-unable-to-connect.aspx" />
        <id>http://williamkent.net/archive/2010/12/10/sharepoint-2010---the-search-request-was-unable-to-connect.aspx</id>
        <published>2010-12-10T12:44:37-07:00:00</published>
        <updated>2010-12-10T12:44:37Z</updated>
        <content type="html">&lt;p&gt;After you have fully configured your search applicatoin, set up the data sources, and confirmed a crawl you might get the following message when you attempt to do a search from your web site&lt;/p&gt;
&lt;p&gt;"The search request was unable to connect to the Search Service."&lt;/p&gt;
&lt;p&gt;There can be a couple of different reasons for this error message, such as ensuring that the right service account is running the Search Windows Service, however there is one quick thing to check that might fix your issue.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Goto Central Administration&lt;/li&gt;

  &lt;li&gt;Application management&lt;/li&gt;

  &lt;li&gt;Manage Web Applications&lt;/li&gt;

  &lt;li&gt;Select the web application&lt;/li&gt;

  &lt;li&gt;Click on Service Connections&lt;/li&gt;

  &lt;li&gt;Ensure that the search application you configured is checked in this list.&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="posttagsblock"&gt;&lt;a href="http://technorati.com/tag/Moss" rel="tag"&gt;Moss&lt;/a&gt;, &lt;a href="http://technorati.com/tag/Sharepoint" rel="tag"&gt;Sharepoint&lt;/a&gt;, &lt;a href="http://technorati.com/tag/Sharepoint2010" rel="tag"&gt;Sharepoint2010&lt;/a&gt;&lt;/div&gt;&lt;img src="http://williamkent.net/aggbug/68.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Pdfs will not open in the browser, just save from Document Libraries in Sharepoint  2010</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2010/12/10/pdfs-will-not-open-in-the-browser-just-save-from.aspx" />
        <id>http://williamkent.net/archive/2010/12/10/pdfs-will-not-open-in-the-browser-just-save-from.aspx</id>
        <published>2010-12-10T12:26:19-07:00:00</published>
        <updated>2010-12-10T12:26:19Z</updated>
        <content type="html">&lt;p&gt;I spent some time researching an interesting issue in Sharepoint 2010 today.&lt;/p&gt;
&lt;p&gt;This involves a set of pdf documents that were stored in a document library.&lt;/p&gt;
&lt;p&gt;We had created a page that contained links to these documents, but the behavior is consistent if you just do it directly from the document library.&lt;/p&gt;
&lt;p&gt;What happens when I clicked on one of the document links in IE was that IE would prompt me to download the file. If I went to other website, and clicked on their Pdf it would open directly in the browser. So I wanted to figure out what was causing this.&lt;/p&gt;
&lt;p&gt;What I found was that Microsoft only opens documents it trusts directly from document libraries, and Microsoft does not trust pdf document, and will force you to download it.&lt;/p&gt;
&lt;p&gt;Here is how you can get around the behavior:&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;Goto Central Administration&lt;/li&gt;

  &lt;li&gt;Application Management&lt;/li&gt;

  &lt;li&gt;Select the Web app you need to modify&lt;/li&gt;

  &lt;li&gt;Click General Settings&lt;/li&gt;

  &lt;li&gt;Change the Brower File handling from Strict to Permissive.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Thats it, your Acrobat document should open directly in the browser in IE now.&lt;/p&gt;

&lt;div class="posttagsblock"&gt;&lt;a href="http://technorati.com/tag/Moss" rel="tag"&gt;Moss&lt;/a&gt;, &lt;a href="http://technorati.com/tag/Sharepoint" rel="tag"&gt;Sharepoint&lt;/a&gt;, &lt;a href="http://technorati.com/tag/Sharepoint2010" rel="tag"&gt;Sharepoint2010&lt;/a&gt;&lt;/div&gt;&lt;img src="http://williamkent.net/aggbug/67.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>My Windows 7 Start menu search bar stopped working and how I fixed it</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2010/02/04/my-windows-7-start-menu-search-bar-stopped-working-and.aspx" />
        <id>http://williamkent.net/archive/2010/02/04/my-windows-7-start-menu-search-bar-stopped-working-and.aspx</id>
        <published>2010-02-04T21:19:00-07:00:00</published>
        <updated>2010-02-04T21:19:00Z</updated>
        <content type="html">&lt;p&gt;One of the feature I rather like in Windows 7 is the search bar in the Start Menu, that allows me to type in pretty much any Application name, and start it.&lt;/p&gt;
&lt;p&gt;No more hunting through the Start Menu hierarchy in order to find that elusive application. It reminds me of a less comprehensive Quicksilver (on Os/x).&lt;/p&gt;
&lt;p&gt;For some reason, after some updates and general usage the search bar stopped working as far as application were concerned. I still to this day am not sure why it stopped working.&lt;/p&gt;
&lt;p&gt;The symptoms where, I would start the Start Menu, and type in for instance "Notepad" and it would show 3 folders, and hitting enter did nothing. Frustrating!!&lt;/p&gt;
&lt;p&gt;I digged around in various options and settings and so forth, for a while without being able to fix my problem.&lt;/p&gt;
&lt;p&gt;Thankfully there is a fix, but its obscure, and require you to &lt;b&gt;reboot&lt;/b&gt; your computer to work.&lt;/p&gt;
&lt;p&gt;The error is due to an invalid registry key.&lt;br /&gt;
&lt;span style="font-family: Calibri; font-size: small;"&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{ef87b4cb-f2ce-4785-8658-4ca6c63e38c6}\TopViews\{00000000-0000-0000-0000-000000000000}&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;This controls the value Start Menu's grouping values. The value is supposed to be:&lt;br /&gt;
&lt;span style="font-family: Calibri; font-size: small;"&gt;“System.StartMenu.Group”&lt;/span&gt;  &lt;/p&gt;
&lt;p&gt;When the search stops working usually and in my case this value was set to Null.&lt;/p&gt;
&lt;ol&gt;
  &lt;li&gt;In order to change this value start regedit.&lt;/li&gt;

  &lt;li&gt;Browse to the &lt;span style="font-family: Calibri; font-size: small;"&gt;HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FolderTypes\{ef87b4cb-f2ce-4785-8658-4ca6c63e38c6}\TopViews\{00000000-0000-0000-0000-000000000000} &lt;span style="font-family: Helvetica; font-size: 12px;"&gt;registry key&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;

  &lt;li&gt;Click Modify&lt;/li&gt;

  &lt;li&gt;Change the value to &lt;span style="font-family: Calibri; font-size: small;"&gt;&lt;strong style=""&gt;System.StartMenu.Group &lt;/strong&gt;&lt;/span&gt;&lt;/li&gt;

  &lt;li&gt;Reboot&lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="posttagsblock"&gt;&lt;a href="http://technorati.com/tag/Windows7" rel="tag"&gt;Windows7&lt;/a&gt;&lt;/div&gt;&lt;img src="http://williamkent.net/aggbug/66.aspx" width="1" height="1" /&gt;</content>
    </entry>
    <entry>
        <title>Sharepoint Saturday in Denver</title>
        <link rel="self" type="text/html" href="http://williamkent.net/archive/2009/11/20/sharepoint-saturday-in-denver.aspx" />
        <id>http://williamkent.net/archive/2009/11/20/sharepoint-saturday-in-denver.aspx</id>
        <published>2009-11-20T09:56:53-07:00:00</published>
        <updated>2009-11-20T09:56:53Z</updated>
        <content type="html">&lt;p&gt;My good friend Ryan McIntyre is on the organizing comittee, and my employer Statera is a corperator sponsor fro the Sharepoint Saturday Event.&lt;/p&gt;
&lt;p&gt;This is an exciting oppertunity to learn about Sharepoint, hear some news about Sharepoint 2010, and network with fellow Sharepoint enthusiast from the Denver area.&lt;/p&gt;http://www.sharepointsaturday.org/denver/default.aspx 
&lt;p&gt;You can sign up right now&lt;/p&gt;
&lt;p style="MARGIN: 0in 0in 0pt" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&gt;Space is limited for these events.  So sign up today&lt;br /&gt;&lt;br /&gt;SharePoint Saturday: &lt;/font&gt;&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032434871&amp;amp;Culture=en-US" target="_blank"&gt;&lt;font color="#0000ff" size="3" face="Calibri"&gt;http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032434871&amp;amp;Culture=en-US&lt;/font&gt;&lt;/a&gt;&lt;font size="3" face="Calibri"&gt; &lt;br /&gt;&lt;br /&gt;Get On The Bus: Vail: &lt;/font&gt;&lt;a href="http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032434880&amp;amp;culture=en-US" target="_blank"&gt;&lt;font color="#0000ff" size="3" face="Calibri"&gt;http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032434880&amp;amp;culture=en-US&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://williamkent.net/aggbug/65.aspx" width="1" height="1" /&gt;</content>
    </entry>
</feed>