Connect ASP.NET MVC4 site to SQLite (Membership, roles, profiles, sessions, etc...) model
Re: Connect ASP.NET MVC4 site to SQLite (Membership, roles, profiles, sessions, etc...) model
Basing on your post (http://forums.devart.com/viewtopic.php? ... 248#p89340), the problem with MSDeploy is solved, isn't it?
Re: Connect ASP.NET MVC4 site to SQLite (Membership, roles, profiles, sessions, etc...) model
I now have everything working and deployed to a server. I believe that the biggest problem I had was an incorrect connection string. This one worked for me:
<add name="DefaultConnection" connectionString="Data Source=|DataDirectory|\DevartMembership.db" providerName="Devart.Data.SQLite" />
Remember that if you change the name “DefaultConnection” that you also have to change it in the context in the AcountModels.cs in the Models folder.
If you create a new connection string to the membership database and leave the DefaultConnection string in the Web.config and use the new string in the controller (thinking you’ve replaced the old DefaultConnection because you’re not using it) everthing will work until you deploy it to the server!
THIS IS BAD it works but will fail on deploy:
<add name="DevartConnection" connectionString="Data Source=|DataDirectory|\DevartMembership.db" />
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-SqlQueryTest-20130307123920;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-SqlQueryTest-20130307123920.mdf" providerName=" Devart.Data.SQLite " />
Also these connection strings don’t work!
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-SqlQueryTest-20130307123920;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\ DevartMembership.db " providerName=" Devart.Data.SQLite " />
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\ DevartMembership.db " providerName=" Devart.Data.SQLite " />
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDBFilename=|DataDirectory|\ DevartMembership.db " providerName=" Devart.Data.SQLite " />
<add name="DefaultConnection" connectionString="Data Source=|DataDirectory|\DevartMembership.db" providerName="Devart.Data.SQLite" />
Remember that if you change the name “DefaultConnection” that you also have to change it in the context in the AcountModels.cs in the Models folder.
If you create a new connection string to the membership database and leave the DefaultConnection string in the Web.config and use the new string in the controller (thinking you’ve replaced the old DefaultConnection because you’re not using it) everthing will work until you deploy it to the server!
THIS IS BAD it works but will fail on deploy:
<add name="DevartConnection" connectionString="Data Source=|DataDirectory|\DevartMembership.db" />
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-SqlQueryTest-20130307123920;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-SqlQueryTest-20130307123920.mdf" providerName=" Devart.Data.SQLite " />
Also these connection strings don’t work!
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-SqlQueryTest-20130307123920;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\ DevartMembership.db " providerName=" Devart.Data.SQLite " />
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\ DevartMembership.db " providerName=" Devart.Data.SQLite " />
<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;AttachDBFilename=|DataDirectory|\ DevartMembership.db " providerName=" Devart.Data.SQLite " />