More RIA Domain Service difficulties with EF
Another error I recently ran into with RIA Domain Services and the Entity Framework model: The type 'ProjectName.Web.YourType' already contains a definition for '_fieldName' This is usually followed immediately by a second error (described the same way) except it shows the property name. This seems to occur when a navigation link in EF is named exactly the same as the internal SQL Server column name. For example, let's say you have a table with a field/column named ModifiedBy (represented as an int, and is a foreign key to another table), when the table is added to the EF model, it is represented...
Invalid member projection specification - RIA Domain Services
While working with RIA domain services and Silverlight 3 beta, I ran across a strange problem. I would create the domain service based on my entity framework model, and the code generated by the domain service wizard was causing a compile error. I verified that the entity framework ran on its own, but it took me a while to figure out why I was getting an error similar to the following: Invalid member projection specification : Projection path 'MyTableId' is invalid for member 'MyNamespace.Web.MyTable.MyTable' This error message is not very friendly. The reason why this happened is because inside...
Securing Silverlight with Custom Forms Authentication
.Net 3.5 and Silverlight 2.0 I've been working on a Silverlight application with a colleague of mine ( John Papa ), and we wanted to create a secure login that would tell the hosting asp.net page to authenticate the user. We looked at Tim Heuer's example and decided to go with a similar approach. This basically involves hosting the WCF Authentication service in a web application, and then creating and using in Silverlight via a service reference. The only issue is that Tim's approach uses the built in .NET membership provider which creates and uses a local SQL Express database. Since the project...
.NET Service Reference compile issues
I was working on a Silverlight application and went to create a service reference to a WCF service. The files generated properly, but when I went to compile I got a few errors that looked similar to below: The type name 'MyService' does not exist in the type 'MyProjectNamespace.MyProjectNamespace' C:\..\Service References\MyService\Reference.cs I though it was very strange because this is code that was generated by Visual Studio .NET 2008. After playing with it for a while, I decided to try creating the reference in another application with nothing in it. It worked perfectly. The problem I ran...
Updated Blu-ray / DVD Comparison Utility
I updated my blu-ray/dvd comparison utility. The new version has a larger set of pre-loaded images to compare against. I also added the ability to create a link that shows the current images you are currently viewing. If you are using the rectangle mode, the created link will be defined so that when others click on it, they can see the original rectangle you created which is good when trying to point out a particular location. Click the following link to check it out: Blu-ray/DVD Comparison I'll be adding more features soon.Problem with casting enums in LINQ to Entities
I've been working with the Entity Framework lately, and I tried to do a LINQ query that returned a record/object with an id that was equal to a value represented by an enum type. I ended up getting the following error: "Unable to create a constant value of type 'Closure.type'. Only primitive types ('such as Int32, String, and Guid') are supported in this context." The code looked similar to below: public void Test(MyEnum mEnum) { var s = (from mt in MyContext.MyTable where (mt.ID == ( int ) mEnum) select mt).FirstOrDefault(); } Even though we are casting mEnum before evaluating it, Linq to Entities...
Post-Sql Saturday
I'd like to thank everyone for attending my SQL Saturday session on SQL Server Management Objects (SMO). A couple of you asked about the source code. It can be downloaded HERE. The project is for Visual Studio 2008, but if you'd like I can make the 2005 project available as well. Let me know if you have any issue with compiling. Thanks!Books by Colleagues
Over the past few months, I've had the pleasure of tech reviewing some awesome books by my fellow colleagues. Brian Peek co-authored "Coding4Fun: 10 .NET Programming Projects for Wiimote, YouTube, World of Warcraft, and More". Brian is well known for writing WiimoteLib , a fully managed .NET Library which allows anyone with .NET experience to integrate the Nintendo Wiimote into their applications. There are two chapters in the book that use this library to create some fascinating projects. One of them is a Wiimote controlled car, and the other is a Wiimote Whiteboard (video: Wiimote Whiteboard...
SQL Saturday 2008, Orlando
I will be presenting at the upcoming SQL Saturday 2008 event in Orlando on October 25th. The session will be an introduction to to SQL Server Management Objects (SMO). For more information about attending this event, please visit the SQL Saturday web site: http://www.sqlsaturday.com/eventhome.aspx?eventid=11 as well as the schedule http://www.sqlsaturday.com/schedule.aspxBlu-Ray / DVD Image Comparison Utility
I've been working on a Silverlight application to compare two images. One from an HD source (such as blu-ray) and one from a standard definition source (DVD). The goal is to see how much of an improvement one can expect if they were to repurchase a movie on blu-ray. Right now, the tool offers a few comparison modes: 1) Dual View - This allows you to see two images as if they were 1. When you move the mouse left or right, you can see more of one image and less of the other. 2) Swap View - This allows you to see one image in its entirety, and then, when mousing over, you can see the other image....
