Page 1 of 1

Why Seed Method does not call ?

Posted: Sun 29 Sep 2013 17:00
by puvinax
Hello
The sample code that I need on my own and it similar to the your sample code you've written
Something went wrong and it is
Seed method is not called in class LeitnerContextCreateDatabaseIfNotExists
Therefore tables can be built
But they can not be made for initial values
Please Guide me
Thanks

Sample Code : http://www.solidfiles.com/d/4632d66fc2/

Re: Why Seed Method does not call ?

Posted: Tue 01 Oct 2013 08:57
by Shalex
Please do right click on your solution in Solution Explorer > Properties > Common Properties > Project Dependencies. Select LeitnerBox in the Projects drop-down and set "Depends on" options for all available projects.
puvinax wrote:Seed method is not called in class LeitnerContextCreateDatabaseIfNotExists
1. Open App.config in the LeitnerBox project and create the connection string with the name of the context you are working with:

Code: Select all

<connectionStrings>
  <add name="LeitnerBoxContext" providerName="Devart.Data.SQLite" connectionString="DataSource=newDb.db3;Version=3;FailIfMissing=False;" />
</connectionStrings>
2. Open Form1.cs and add the following line after creating the leitner variable:

Code: Select all

leitner.Database.Initialize(false);

Re: Why Seed Method does not call ?

Posted: Tue 01 Oct 2013 13:46
by puvinax
WOW Super Fantastic !!!
THANKS for your efforts :) :) :)