Page 1 of 1
Code First ctp5 example that works with SQLite
Posted: Mon 28 Feb 2011 22:50
by iguanamind
I'm looking for a Code First ctp5 example that works with SQLite. I have been killing myself over the last few days. Anyone have any code samples with the connection string as well. It seems that I am having issues with not using the required Metadata keyword correctly. But even there I am not sure because I am don't know how this all works together. I need a working example really.
Posted: Wed 02 Mar 2011 09:57
by AndreyR
Take a look at
this article, it deals with Code First support peculiarities in dotConnects.
The sample is available for download
here.
sample
Posted: Thu 03 Mar 2011 15:46
by iguanamind
First off, thanks for replying. And the example is pretty extensive and helpful compared to anything else I have seen on the subject. The problem is that it doesn't work. It compiles. And I have spent a couple hours trying to get it to run but it doesn't. I am still trying to find the source of the problem, but this is the exception:
{"SQLite error\r\nno such table: TEST.Company"}
Any ideas?
fixed it
Posted: Thu 03 Mar 2011 16:17
by iguanamind
I figured it out. The default schema for the MySqliteContext class is "Main", but the SchemaName for the Entities in Entities.cs is "TEST". Cracked open the sqlite file to verify the database name is "Main". I changed the schemaname for all of the Entities to "Main", works fine.
Posted: Thu 03 Mar 2011 16:42
by AndreyR
Glad to hear the issue is resolved.