Getting a simple SQL Compact Edition Sample Running
<>
Hi all.
I'm new to Fluent and NHibernate. I've download all the Fluent source code and was able to get it all compiled and run the Examples.FirstProject console app.
Now I've created a clone of that console project (within the same solution) and I'm trying to now use SqlCE for my database. I added my own blank .sdf file along with a project reference to System.Data.SqlServerCe. I've also included all my C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\sqlce.dll's as resources that are copied to my \bin directory.
I'm trying to do everything the same thing that the sample app does: that is, connect to a blank SqlCE database, have Fluent create the schema and build the database on the fly, and then do some testing CRUD work.
I'm getting stuck in my BuildSchema() function when I'm doing a SchemaExport. I'm having an assembly load with the error message "Could not load file or assembly 'System.Data.SqlServerCe' or one of its dependencies. From the FusionLog in the exception it seems like NHibernate is trying to call that assembly.
So, my main question is: what is the right way to know which Fluent version to use with with NHibernate dll's (and which versions) and which SQLCE dll's (and which versions)? Am I running into problems because NHibernate is expecting that I'm using a specific version of dll for SqlCe?
Finally, does anyone have a small sample of working Fluent code that takes a SQLCe database and populates it with a schema from my C# business objects?
Thanks for the help.
Mark
ReferencesUsed.gif 18.6 KB
AssemblyError.gif 78.9 KB
- Program.cs 5.6 KB
Comments are currently closed for this discussion. You can start a new one.
2 Posted by marksisson on 13 Mar, 2010 11:23 PM
Problem solved - sorry for the waste of time. My System.Data.SqlServerCe.dll wasn't copied locally. I thought I had already checked it but evidently not.
Paul Batum resolved this discussion on 15 Mar, 2010 11:30 AM.