sql - C# Application EntityFramework CodeFirst and database -
i developing c# application entityframework , codefirst model. have local database on each machine , each application installation. mean when user x installs application on machine application should create , use local database file. tried sqlite had no luck making work following connection string , dbfactory in app.config
<connectionstrings> <add name="facebotdb" connectionstring= "data source=|datadirectory|facebotdb.sqlite" providername="system.data.sqlite" /> </connectionstrings> <system.data> <dbproviderfactories> <add name="sqlite data provider" invariant="system.data.sqlite" description="data provider sqlite" type="system.data.sqlite.sqlitefactory, system.data.sqlite" /> </dbproviderfactories> </system.data> i exception of sort "invariant must unique". main question if sqlite best choice in such case. there other database can use entityframework , store it's files locally. please note can use sqlite pure ado.net that's going happen if have no other choice since ef has lot of benefits.
"microsoft sql server compact edition" best alternative sqlite. stores it's files locally , of orms support it.
the best way install in project using nuget @ http://nuget.org/packages/sqlservercompact/
Comments
Post a Comment