November 2009 Blog Posts

Pictures from PDC09

Here are some of the pictures I took while in LA for PDC09.  I had a great time and I hope that I get the chance to attend more conferences. The Standard has its name upside down for the logo. I tried to take a picture of the desk at night, but it was pitch-black dark, with only small lights under the counter top in the back. When I entered, there was live jazz music playing (loudly) and it felt much more like a nightclub than a hotel. The lobby is...

posted @ Saturday, November 21, 2009 7:35 PM | Feedback (1)

(Not) Doing Back Flips with DomainDataSource [SubmitChanges sends user to first page]

When changes are successfully submitted and you have paging enabled, it’s quite possible that some of the entities that have been edited now belong to a different page.  Say for instance you are viewing employees ordered by last name, and you edit one of the employees to change their last name, moving them from Jones to Adams.  After submitting changes, what should happen?  Should Adams continue to show up on the 6th page, or should the data be refreshed to place everyone where they belong? A few months ago, we made the decision to invoke a fresh load after...

posted @ Saturday, November 21, 2009 9:40 AM | Feedback (3)

DomainDataSource Error Handling

With the RIA Services July 2009 Preview release, we heard significant feedback about the DomainDataSource error handling story.  The biggest problem was when errors occurred during Load() or SubmitChanges(), server-side errors would be silently swallowed unless you opted into the LoadError, LoadedData, and SubmittedChanges events, and explicitly checked for errors.  With the PDC release, we've change this behavior, among others related to error handling. Different Error Conditions The DomainDataSource can encounter errors in several different ways: Load() is called when its prerequisites are not yet met.  For instance, there is no DomainContext specified, the...

posted @ Thursday, November 19, 2009 8:29 PM | Feedback (21)

DomainDataSource Error Handling (Original)

There was an error with the original post for this topic. Please click the following link to see the corrected post: http://jeffhandley.com/archive/2009/11/19/domaindatasource-error-handling-again.aspx.

posted @ Thursday, November 19, 2009 12:00 AM

Building ContosoSales - The RIA Services Keynote Demo

During Scott Guthrie’s keynote at PDC09 (starting around 1:28:00), Scott Hanselman presented a demo that highlighted Visual Studio 2010, Silverlight 4, RIA Services, and lots of great new tooling that ties all of these products together.  I wanted to show you how you can build the same application using installations that are available today. Machine Setup You’ll need to install Visual Studio 2010 Beta 2 if you haven't already.  If you have a previous release of RIA Services already installed, you’ll need to uninstall it before proceeding.  Please note that you want to keep the Silverlight 3 SDK installed...

posted @ Wednesday, November 18, 2009 10:04 AM | Feedback (16)

DomainDataSourceView API (DomainDataSource.DataView)

DomainDataSource has two properties for getting the data out of it: Data and DataView.  The Data property is what’s intended for exposure in Binding scenarios, for instance binding a DataGrid to the DomainDataSource.  This property is typed very simply as an IEnumerable.  The DataView property however is intended to be used for programmatic access to the entities exposed by the DomainDataSource.  While the two properties currently return the same collection instance, this might not always be true, so it’s good to properly set the expectations of these two properties.  If you need to work with the collection from the DomainDataSource,...

posted @ Monday, November 16, 2009 3:58 PM | Feedback (4)

DomainDataSource DataPager PageSize Pitfall

During the PDC release milestone of RIA Services, we discovered an error from DomainDataSource when using AutoLoad="True" and when using a DataPager bound to the DomainDataSource’s Data property.  We found that when the PageSize property is specified on the DataPager and not on the the DomainDataSource itself, an exception would often (but not always) be thrown from DomainDataSource, indicating that a load could not be invoked while another load was in progress.  The reason for this will actually interest you most if you use AutoLoad set to False. The issue is easiest to explain with a series of events...

posted @ Monday, November 16, 2009 3:12 AM | Feedback (5)

DomainDataSource – Single Record Results

While the DomainDataSource is most often used for loading entire sets of records, it can also be used for loading a single record result.  This is a topic I’ve seen a few people talk about, assuming it’s a difficult thing to do, and even creating solutions for a problem that doesn’t exist.  I want to dispel the myth here: DomainDataSource can in fact be used to easily bind to a single record result. Let’s create a DomainService that has a method to get the most recent error from the AdventureWorks database: ...

posted @ Tuesday, November 10, 2009 10:33 AM | Feedback (2)