Thursday, January 24, 2008

This is a small milestone for me.

I had to add a feature to a website for a client and thought it would be a great opportunity to use LINQ to SQL. So I built the feature with LINQ to SQL , had the sysadmin add .NET 3.5 runtime to the webserver and deployed it.

Works great!

Big grin....

Thursday, January 24, 2008 2:24:18 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

My last post was about LINQ and EF Data Providers, which made me think of this.

I received an email recently asking if I knew of anyone writing an Entity Framework provider for Access.

I don't happen to know of any.

However there's a reason.

In the forums, there is a post from July where Danny Simmons explained the hurdles with a possible Access provider:

The OLE-DB ado.net provider has not been extended to support the entity framework, and we do not currently have plans to do so in our first release.  Further, this would be a fairly difficult effort because OLE-DB doesn't provide enough information in general to translate CQTs (canonical query trees--the entity framework intermediate query representation) to a particular back-end query syntax.  So, while it would be possible to write an Access provider which would translate from CQTs to the particular query syntax that access uses, we don't have an access-specific ado.net provider, and the general OLE-DB provider would not be able to do the job.

We have done some internal prototyping of how Access and the entity framework might work great together in the long-run, but those were just explorations, and we will not have direct support for Access in the first release of the entity framework.

 

Thursday, January 24, 2008 1:00:53 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 

People are always asking "when will I be able to use LINQ against databaseA or databaseB?" and "when will I be able to use Entity Framework against databaseA or databaseB?"

In my mind this is the same question, though most who are asking don't realize it. Why?

An Entity Framework provider gets all of the benefits of the Entity Framework and also gets LINQ for free by way of LINQ to Entities.

If a database vendor wants developers to be able to perform LINQ queries against their database, it's not a stretch to think that they might also want developers to be able to use their database within the Entity Framework.

Why write two providers (a LINQ provider AND an EF provider) when they can write just an EF provider and with it, get LINQ capabilities as well?

An added benefit is that with Entity SQL, it is possible to add provider specific functions.  So when a developer reaches a wall trying to write a LINQ query, the can just step back and use Entity SQL for those cases.

I'm definitely using LINQ to SQL where it makes sense for me. In fact, I'm waiting for a sysadmin to throw .NET 3.5 on my client's web server so I can deploy my first production solution that uses LINQ to SQL! :-)

But for any other db's, I'm not waiting to see who is writing LINQ providers for their databases, but who is writing EF providers (here's a current list, by the way).

Thursday, January 24, 2008 10:21:16 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 

This weeks Seven Days features Vermont's Tech businesses and the Vermont 3.0 Tech/Creative Career Jam that is happening on Saturday (Jan 26) in Burlington. There are 50 companies that are registered as exhibitors for the career portion of this - most of them are looking for some type of technical workers - engineers, programmers and more. There was only space for 50 and there's a long list of companies that are begging to get in as well.

The issue talks to a number of these companies and also surveys the state of the industry and career opportunities.

So if you aren't local and can't pick up Seven Days in print, you can read all of these articles in the paper.

Seven Days home

Seven Days TechBiz Issue starting point

  • VT Tech Biz Issue: Is Vermont's "brain drain" reality or rhetoric : Title speaks for itself
  • VT Tech Biz Issue: Sensor and Sensibility : Microstrain - Very successful tech company in Vermont
  • VT Tech Biz Issue: They've Got Game : Champlain College's Innovative Video Game course
  • VT Tech Biz Issue: Soft...where? : A closer look at five of Vermont's software companies
  • VT Tech Biz Issue: Good to the Last Byte : Even the food writer gets in on the trend
  • VT Tech Biz Issue: Clicks to Licks : Guitar Hero!
  • VIDEO: The Campus Question: St. Michael's College
  • VIDEO: Stuck in Vermont: Dealer.com : Video Blogger Eva Solberger visits one of Vermont's hippest, fastest growing software companies
  •  

    Thursday, January 24, 2008 9:46:46 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

    (note that RSG is also currently looking for a web developer with less experience required than the position below)

    RESOURCE SYSTEMS GROUP is a multi-disciplinary, employee-owned consulting firm specializing in the planning, analysis, and management of business, infrastructure and natural resources. We serve clients who share our belief that high-quality, objective analysis is a prerequisite to resolving complex problems. More than just analysts, scientists, and engineers, we’re communicators – our study results are clear, concise, and directly applicable to a client’s particular questions and challenges. Our solutions are creative and grounded by 20 years of experience with clients as large as federal government agencies and Fortune 500 companies or as small as neighborhood interest groups and local municipalities.

    Senior Associate – Software Development
    White River Junction, VT or Chicago, IL

    This position involves working with the Technology Solutions Practice, supporting the firm’s software and analysis needs. The primary focus will be developing fully dynamic web-based solutions from interface to business logic to back end database design. Managing clients’ expectations throughout the project lifecycle is a key responsibility.  We are looking for someone who is organized, analytical, and experienced in delivering best practice solutions to join our team.

    • Minimum bachelor’s degree with emphasis in computer science or a related field
    • Minimum 3 years experience working on large client projects.
    • Demonstrated software development, programming, design and technical presentation skills.
    • Outstanding written and oral communication skills.
    • Practical experience in the following areas:
    o Web Development in HTML and CSS
    o Database programming in SQL
    o Modern object-oriented programming (e.g. C#, VB.Net, Java)

    This position may be located either at White River Junction, Vermont or Chicago, Illinois.   Telecommuting from another location will be considered for the right candidate.
    Please send resume and cover letter to Recruiting Director at employment@rsginc.com and indicate Senior Associate Software Development in the subject heading.
    Recognized as one of the “Best Places to Work in Vermont” and recipient of the 2007 Dean C. Davis Outstanding Business Award, RSG employees enjoy excellent benefits, flexible hours and opportunities for advancement.
    We are an equal-opportunity/affirmative action employer.
    Please visit www.rsginc.com for more information on Resource Systems Group.

    Thursday, January 24, 2008 9:31:08 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
     Wednesday, January 23, 2008

    Burlington, VT PHP Users Group Meeting

    RSVP Required

    When: Wednesday January 30th, 2008, 5:30 pm - 7:30 pm
    Where: Brown & Jenkins Coffee Roasters, 91 Ethan Allen Drive, South Burlington, VT 05403

    Topics 

    Bradley Holt will be giving a presentation on developing a web application using Zend Framework. Bradley Holt is founder and web developer for Found Line, a local design and development studio which has used Zend Framework in several recent projects. He also works as a software developer for a local non-profit. Before starting Found Line he worked as computer trainer teaching a variety of subjects including Java/JSP, ASP.NET, and PHP.

    Other topics will include:

    • What tools do you use for your development environment?
    • What subjects and presenters would you like to see in future?

    Refreshments - coffee and snacks - will be provided, and you'll have the chance to network and connect with fellow PHP developers.

    To Participate

    1. RSVP by email to Rob Riggen <rob@riggen.org>.
    2. Sign up for the Burlington, VT PHP User Group list on Google Groups.
    3. Forward this link to anyone else you feel would be interested in the topics above.
    Wednesday, January 23, 2008 5:20:55 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

    Bill McCarthy explained this to me in an email.

    He wrote about it in this excellent article in Visual Studio Magazine "Drill Down on Anonymous Types".

    But it still bit me in the ass!

    So I am stamping this into my memory:

    in a query results in
    ...select cust.CustomerID.cust.CompanyName...  Immutable anonymous type
    ...select New With {
                                    .CustomerID=cust.CustomerID,
                                    .CompanyName=cust.CompanyName} ...
    Mutable anonymous type
    ...select New With {
                                 Key .CustomerID=cust.CustomerID,
                                 Key.CompanyName=cust.CompanyName} ...
    Immutable anonymous type
    Direct creation of object  
    New With {
                     .CustomerID=cust.CustomerID,
                     .CompanyName=cust.CompanyName}
    Mutable anonymous type
    New With {
                      Key .CustomerID=cust.CustomerID,
                      Key .CompanyName=cust.CompanyName}
    Immutable anonymous type

    And just in case someone who really needs this stumbles on this post, two clarifications:

    1. All anonymous types are immutable in C#.
    2. Mutable means changeable, editable. Immutable means written in stone.
    VB
    Wednesday, January 23, 2008 4:48:31 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [3]  | 

    Ranting about the lack of updated images to use in our app development was a passion of mine for a short while (prior to VS2005). I just looked at what's included in VS2008 and was happily surprised! Read more...

    [A New DevLife Post]

    Wednesday, January 23, 2008 1:41:41 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
     Tuesday, January 22, 2008

    I accidentally opened up a web application project as a website. That's not too hard to do. Just say you want to open a web site and point to the folder. It had been a while and I forgot that it was a WAP.

    So I'm working on a web page and double click on a control and find myself in the markup with a new script tag and the .net code for the click event of the control. That wasn't good considering I already had some nice event handlers for that control in my code behind.

    I spent a lot of time going back and forth trying to figure out why I couldn't get to my code behind.

    I even remembered having this problem in the early days of Web App Project and the solution was to "convert to a Web Application Project" from the context menu in the solution explorer. But this option wasn't available.

    I created a new web site and looked at the page directive and noticed that in the new website the parameter pointing to the code behind file was called CodeFile, but in my old site it was CodeBehind. Wierd.

    So with that clue I googled those two words, came across Steve Smith's blog post about the opposite problem and realized my mistake!

    Duh. :-)

    Tuesday, January 22, 2008 8:36:14 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 

    It seems to me that Danny Simmons must be working on v2 of Entity Framework.

    The posts he has written in the past week are examples of things that would probably have been in V1 had they had the time and resources. Now they are winding down v1, building up the team and thinking about v2.

    Danny has written three blogs posts filled with really handy extension methods for entity framework (and LINQ to Objects) [here's the third which contains pointers to the first two] and now he is building a state bag for dealing with getting  entities across boundaries SOA style (i.e. web services and dealing with the limitations of XML serialization - something many of us have been writing about for a while).

    I"m really pleased to see this coming out of Microsoft (although what happened to whitepapers? ;-)). I have come up with my own methods (some with help from Danny and some on my own) but it's always a little unnerving when you are just making your best guess at what they might have planned for.

    Months ago I started a thread on the MSDN forum about this issue and it ended up being a 3 or 4 page thread because every time someone on the team said "well, just do this" I said "no - that doesn't really solve the problem". I was pretty relentless (thanks to all of the work I have done with web services and ws-* in the past) and finally Danny ended the thread with "okay, obviously there's more we need to look at here."

    Since then I have struggled to come up with disconnected solutions that deal with binary and xml serialization and presented them at a few conferences. This was with Beta2 and there are some new goodies in Beta3 that will ease the pain somewhat but it's still pretty complex.

    For the last week or so, Danny has been writing a series of blogs where he's using his indepth understanding of entities, object services, statemanagment, etc. to build a "state bag" for transferring the whole kit 'n caboodle across processes. It's impressive as hell but there was something bugging me that I was dwelling on, and Roger Jenning's pointed it out on his blog as well.The answer to "why is ObjectContext not serializable?" is that it's big and it would not be scalable. And no, I'm not suggesting that Danny forgot this. :-) Which is why I'm biding my time to see how it comes out.

    I'm assuming that Danny's state bag is a proof of concept for a v2 solution (though he has been clear that because of some obvious issues with interop, it just may not go in.) And as he suggested in today's post, readers (like me) are probably "chomping at the bit" to see how he does the object context part so that we can see how streamlined it is.

    Most people have no clue how deep Entity Framework goes and what the ADO.NET team is setting up for us to be able to do with it down the road. It's probably clear by now that I'm really excited about Entity Framework and I'm struggling to keep up with all of the great ideas that people are trying out as evidenced in the forums.

    So while we're all looking forward to the release of Entity Framework, I'm already starting to get excited about what's going to come in V2.

    Tuesday, January 22, 2008 7:17:31 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

    I've been thinking about the EntityDataSource that has been mentioned in the forums. It is something that is going to be added to Entity Framework by RTM, but it doesn't exist in current bits for us to experiment with.

    The reason I've been thinking about it is because of some of the issues/confusion with the LINQDataSource and I'm really hoping that the EF team will be looking at that, learning from it, and making sure that some of those problems don't exist in the new component.

    Most of the issues with the LINQDataSource are a result of very realistic limitations. But where I see the problem is just the difficulty many users have using it because they don't understand what's going on underneath and to work within the limitations, there are some very non-intuitive things they need to do.

    I wrote a bunch of LINQDataSource demos for a presentation and spent a lot of time learning workarounds in order to achieve some very common scenarios although not quite as common as the typical demos. That's where I hope EntityDataSource makes it easier. I don't want to have to work so hard to discover how to make it work.

    Here's an example of a something I think is a common scenario.

    I have an Entity for SalesOrderHeaders from AdventureWorksLT.

    I would like to have an editable gridview of these records.

    I'd like to display the customer name in the grid not the customer ID.

    Not too strange, right?

    But there are a lot of issues encountered along the path to create this solution.

    1)One of the most often asked questions about the LINQDataSource is "why can't I edit?". The answer is most often because the developer selected the fields they wanted displayed in the grid and a huge number of people don't realize that they are creating an anonymous type by doing this. Yes there are some clues. The "advanced' button goes away. There's no "enable delete" etc. checkboxes on eh Task menu.

    A better way? It would be much easier if the wizard started out by asking if you have any intention of editing and if the answer was yes, does NOT present the end user with the option to select fields.

    An even better way? I know the model won't allow this but it would be great to have another entity definition (subset of the properties) for this entity without creating an EntityKey conflict.

    2) This also means that I can't really take touch the CustomerName in the EntityRef (SalesOrderHeaders.Customer)unless I create an anonymous type, which I don't want to do. So the next obvious solution is to create a LINQDataSource for the Customers and format the CustomerID column in my gridview to be a template field with a dependency on the CustomerLINQDataSource.

             <asp:templatefield HeaderText="CustomerID" SortExpression="CustomerID">
                        <edititemtemplate>
                            <asp:DropDownList ID="DropDownList1" runat="server"
                                DataSourceID="LinqDataSource2" DataTextField="CompanyName"
                                DataValueField="CustomerID" SelectedValue='<%# Bind("CustomerID") %>'>
                            </asp:DropDownList>
                        </edititemtemplate>
                        <itemtemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("Customer.CompanyName") %>'></asp:Label>
                        </itemtemplate>
                    </asp:templatefield>

    But this creates yet another problem that I may not have any awareness of. The default deferred loading will cause an extra round trip to the database for each SalesOrderHeader record to get the CustomerName.

    A better way? Give us a Deferred Loading or Eager Loading option in the wizard!

    3) There is a really weird gotcha because we are using EntityRefs for the CustomerID/CustomerName DropDown. Editing doesn't work properly unless you set the LINQDataSource property to StoreOriginalValuesinViewState to False. It's logical but again, totally non-intuitive. If you don't do it, you will get this error message:
    "System.InvalidOperationException: Could not find a row that matches the given keys in the original values stored in ViewState.  Ensure that the 'keys' dictionary contains unique key values that correspond to a row returned from the previous Select operation." That's scary, huh? It took some googling to figure this one out.

    A better way? If the LINQDataSource could trap this exception and give some better guidance about what the problem is and how to deal with it. Or something...


    These are some of the things I spent a ridiculous amount of time on in order to get this scenario working. And seems like nothing compared to what Roger Jennings banged his head on!

    It would be great not to have to go through this again with the ObjectDataSource, if it's possible to make some of these issues easier to deal with!

    Tuesday, January 22, 2008 12:30:15 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [1]  | 
     Monday, January 21, 2008

    I was just bemoaning the fact that I won't be able to drive to Boston for David Chappell's special appearance at a multi-user group event at the end of the month when I discovered that he'll be doing the keynote at the Developer Summit in Stockholm, Sweden where I will also be presenting.

    <plug> I'll be doing a full day workshop on Entity Framework as well as an Advanced EF session and a Silverlight Annotation session.</plug>

    Monday, January 21, 2008 7:39:11 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

    Kathleen Dollard recently wrote about VS2008 letting us easily make our app settings publically accessible to other projects. It inspired me to share my solution for how I did this in VS2005 when it wasn't so easy. Read more...

    [A New DevLife Post]

    Monday, January 21, 2008 1:54:23 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
     Sunday, January 20, 2008

    For the last bunch of years, Rich and I have subscribed to Netflix during the winter when it gets dark early and cancel it around late spring when we can stay outdoors later, then start up again around Christmas time.

    When Netflix introduced streaming this summer, we started looking into options for connecting our laptops (no s-video or DVI) to our TV. We never thought of watching the movies on our computers. At first, the offer was that you could watch as many hours as the cost in dollars of your plan - $19/month for the 3 movies at a time plan meant you could also watch 19 hours online. Which should be more than enough!

    But that all changed recently when Netflix opened up the streaming with no limits (that I'm aware of).

    We still, however, don't have the hookup for the tv.

    But I've been sick with a really nasty cold for the past week which seems to get worse and worse. Can you imagine ME actually not being able to talk! (Yes, Rich thinks its a small miracle! :-)) But today, I curled up in bed where I wanted to be, picked a sweet, not quite sappy, indy film (The Treatment) and watched it over the wireless network in our house. It was perfect.

    There was a point when it went a little crazy because I ran out of room on my C:\. SO I had to crash it and go clean up things like the 4GB VS2008 install file that was on my desktop and then I watched the rest of the movie with no problems.

     

    Sunday, January 20, 2008 6:57:54 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 
     Saturday, January 19, 2008

    And you thought Microsoft files a lot of patents!

    Here's the article:

    http://www.burlingtonfreepress.com/apps/pbcs.dll/article?AID=/20080119/BUSINESS/801190312/1003

    Saturday, January 19, 2008 10:26:37 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

    I had never really though thought about using a spell checker for my code comments before. A blog post on the WebDevTools team blog got me thinking more about it. Read more

    [A New DevLife Post]

    Saturday, January 19, 2008 11:05:34 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 
     Friday, January 18, 2008

    I was moving some code around and had a nice WCF Service Interface and Service Class created. So I copied them into a new project where I was re-creating my work.

    When I tried to debug (self-host) the service, just to test it out with the embedded WCF Test Client.

    But I kept getting this error:

    "The client was unable to retrieve service metadata. Make sure the service is running and exposing metadata."

    This made no sense. My config file was fine. I even created a new WCF service in the solution, confirmed that it worked properly, then compared the config files line by line.

    No problems.

    After going around in circles for a while (including getting zero google results for that error message), a thought occurred to me. I copied and pasted the entire contents of the Interface and the service class. I hadn't changed the namespace!

    That was the problem. I fixed the namespace and the service ran in the Test Client just fine.

    Friday, January 18, 2008 4:52:42 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [2]  | 

    A few weeks ago, I was mooning over Extension Methods. Somehow, in the collection of language enhancements to VB9 and C#3, they have become a bit of a sleeper feature in light of LINQ. Everything is though, right?

    So I wrote about them and thought about them, but then went back to my task at hand.

    Danny Simmons also recently started seeing the light about Extension MEthods. But instead of going back to what he was doing, he spent quite a bit of time playing with them and is now blogging an Entity Framework Extension Method Extravaganza!

    He's going crazy with it already. What fun!

    Friday, January 18, 2008 1:59:26 PM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

    How dorky is it that two programmers are all excited about showing each other the complex reports they have pulled off with Crystal? :-)  read more

    [A New DevLife Post]

    Friday, January 18, 2008 8:44:37 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  | 

    You can now finally get at the .NET Source code through VS2008! Read more

    [A New DevLife Post]

    Friday, January 18, 2008 8:42:43 AM (Eastern Standard Time, UTC-05:00)  #     |  Comments [0]  |