Monday, August 22, 2011

SSRS 2208 Multi-value Default Parameters Not Being Used

I spent about an hour trying to track down what was causing my default multi-values from appearing in Business Intelligence Development Studio (BIDS) AKA Visual Studio 2008 (VS2008).

My dataset is simply a one-dimensional list of names of human beings, such as John Doe. The default values are were a subset of those names but they were not being selected either in Preview in BIDS or on the server.

This post gave me the idea to check my list of default values against the dataset. I knew that I didn't have NULL values in my dataset, but I realized that I did have some default values that didn't correspond to the list of values in my dataset. The default values had until recently matched their counterparts in the dataset, but staff turnover had changed two of the values from "Firstname Lastname" to "Firstname Lastname (DOMAIN\USERNAME)". As soon as I removed the two non-corresponding values all was well- the default values were selected as desired and the report again started executing as expected.

Tuesday, August 9, 2011

ELMAH, NuGet, SQL Server Compact 4.0, and EF Code-First

ELMAH + NuGet + SQL Server Compact 4.0 + EF Code-First = Trouble!

Following Scott Hanselman's directions, I installed ELMAH on Microsoft SQL Server Compact 4.0 (SQL CE). Because of the dependency of 'ELMAH on MS SQL Server Compact' on SQL CE (and I already had the 'Manage NuGet Packages' window open) I let NuGet install it for me. NuGet installed everything perfectly and soon I was happily logging exceptions and storing them in a *.sdf file. Cool.

I also used NuGet to install Entity Framework 4.1 and followed Scott Guthrie's post on Code-First Development with Entity Framework 4. I created a model, added a connection string to my ASP.MVC 3 application, and soon I was persisting data to a second *.sdf file. Still cool.

Finally it was time to push my application to a server. This is where things became uncool.

Could not load file or assembly 'System.Data.SqlServerCe.Entity, Version=, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
After confirming that System.Data.SqlServerCe.Entity was in the bin directory, I started reviewing the versions of the SQL CE files, and then just to be sure I copied all of the files from my local installation of SQL CE to the server again. The problem still persisted.

I had used NuGet to install the version of SQL CE that ELMAH was using so I decided to research what the expected file versions were. These two great posts by ErikEJ caused me to formulate a theory that perhaps ELMAH and EF 4.1 were using the wrong or conflicting file versions. I made two changes to my application to test my theory.
  1. Altered DbProviderFactories in my web.config file as described in this article.
  2. Set up a binding redirect for System.Data.SqlServerCe as described in this article.
After making these two changes exception logging and data persistance to my two compact databases started working on the server. Maybe it's just me but it seems that a significant percentage of development troubleshooting is pure intuition!