Need help configuring SQL Server CE connections string in Fluent NHibernate

Posted by Yoav on Stack Overflow See other posts from Stack Overflow or by Yoav
Published on 2010-12-30T16:35:46Z Indexed on 2010/12/31 3:54 UTC
Read the original article Hit count: 286

Filed under:
|
|

Hi,

I'm trying to return a session factory using this code:

return Fluently.Configure()
.Database(MsSqlCeConfiguration.Standard.ShowSql().ConnectionString(path))
.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Project>())
.BuildSessionFactory();

Path is the full path to an .sdf file.

And get this exception:

System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
   at System.Data.SqlServerCe.ConStringUtil.GetKeyValuePair(Char[] connectionString, Int32 currentPosition, String& key, Char[] valuebuf, Int32& vallength, Boolean& isempty)

What am I doing wrong?

© Stack Overflow or respective owner

Related posts about c#

Related posts about sql-server