Subsonic 3 – Update NullReferenceException

subsonicsubsonic3

I am using Subsonic v3.0.0.3 with the Linq templates. I am attempting to update a record in a SQL Server Express database with the following:

var db = new MyDB(Constants.Database);
db.Update<Contact>()
  .Set(d => d.FirstName == contact.FirstName)
  .Where(d => d.Id == contact.Id)
  .Execute();

I am receiving a NullReferenceException when this line is executed. The stack trace is as follows:

   at SubSonic.Query.Update.GetCommand()
   at SubSonic.Query.Update.Execute()

Any chance that someone may be able to suggest what the problem is?

Best Answer

Hmm - I would say to make sure the connection string is present (I'll be fixing the error message for missing connection strings in the coming weeks) other than that - this looks like an issue - would you mind posting at Github?

Related Topic