Wednesday, July 14, 2010

Could not create the driver from NHibernate.Driver.SqlServerCeDriver

Using Fluent NHibernate and MsSqlCeConfiguration, I wanted to use an SQL Compact DB for my Database by changing the FluentConfiguration but I started getting the errors from the InnerException.

"Could not create the driver from NHibernate.Driver.SqlServerCeDriver"

The fix is simples,

You need to add a reference to

"System.Data.SqlServerCe"

Located in

"C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Desktop\System.Data.SqlServerCe.dll"

If you don't have it, you'll need to install it from.

http://www.microsoft.com/sqlserver/2005/en/us/compact-downloads.aspx

Once you've added it you need to set the

"Copy Local" to true.

Then you should be good to go.

6 comments:

  1. Thanks... you saved my bacon today.

    ReplyDelete
  2. No problem! :) Glad it helped someone else.

    ReplyDelete
  3. Thanks. I already had a reference to System.Data.SqlServerCe, but it was the .NET 4.0 version. I added this to my config to fix it.

    ReplyDelete
  4. Your small post saved me big

    ReplyDelete
  5. Thanks! Worked like a charm!

    ReplyDelete
  6. Thanks, It is what I was looking.

    ReplyDelete