[Firebird-net-provider] Entity Framework 5, code first: database created, then crash

2012-09-27 Thread Sibylle Koczian
Hello,Im trying to create a Firebird database in a small test application using Entity Framework 5 with Code First, but it doesnt work.Versions of everything:Windows 7 Home Premium, 64 bitFirebird 2.5.1Firebird net provider 2.7.7 (installed in the GAC, correct entries in machine.config)Visual Studio 2012 Express for DesktopThe exception I get (line is shown in the code):-  InnerException {Fehler beim Aktualisieren der Eintrge. Weitere Informationen finden Sie in der internen Ausnahme.} System.Exception {System.Data.UpdateException}[Failed to update the entries. More information, see the inner exception]+  InnerException {Dynamic SQL ErrorrnSQL error code = -204rnTable unknownrn__MigrationHistoryrnAt line 1, column 8} System.Exception {FirebirdSql.Data.FirebirdClient.FbException}The database is created, it has two tables: the table described in the model and a second table HistoryRow with the columnsMigrationId Varchar(255) not null, primary keyModel Blob sub_type 0 not nullProductVersion Varchar(32) not nullBoth tables are empty. What is wrong?The app.config:?xml version=1.0 encoding=utf-8?configuration configSections !-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -- section name=entityFramework type=System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 requirePermission=false / /configSections startup supportedRuntime version=v4.0 sku=.NETFramework,Version=v4.5 / /startup entityFramework defaultConnectionFactory type=System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework parameters parameter value=v11.0 / /parameters /defaultConnectionFactory /entityFramework connectionStrings add name=EinkaufContext connectionString=Database=localhost:einkauf;User=sib;Password=immergut;Charset=ISO8859_1 providerName=FirebirdSql.Data.FirebirdClient / /connectionStrings/configurationThe code:namespace CodeFirst_Konsole_1{ class Rubrik { public string RUBID { get; set; } public string RUBNAME { get; set; } }  class EinkaufContext : DbContext { public EinkaufContext() : base(name=EinkaufContext) { }  public DbSetRubrik Rubriken { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { // base.OnModelCreating(modelBuilder); modelBuilder.EntityRubrik().ToTable(RUBRIK); modelBuilder.EntityRubrik().HasKey(t = t.RUBID); modelBuilder.EntityRubrik().Property(p = p.RUBID) .HasMaxLength(3) .IsFixedLength() .IsUnicode(false); modelBuilder.EntityRubrik().Property(p = p.RUBNAME) .IsRequired() .HasMaxLength(50); } } class EinkaufContextInitializer : DropCreateDatabaseIfModelChangesEinkaufContext { protected override void Seed(EinkaufContext context) { // base.Seed(context); } } class Program { static void Main(string[] args) { Database.SetInitializerEinkaufContext(new EinkaufContextInitializer()); using (var db = new EinkaufContext()) { var newrub = new Rubrik { RUBID = AAC, RUBNAME = - }; db.Rubriken.Add(newrub); // --- Exception here int recordsAffected = db.SaveChanges(); Console.WriteLine({0} Stze in die Datenbank geschrieben., recordsAffected); // Abfragen var allrubs = from p in db.Rubriken select p; foreach (var item in allrubs) { Console.WriteLine(Kennung {0}, Name {1}, item.RUBID, item.RUBNAME); } } Console.WriteLine(Weiter mit jeder Taste ...); Console.ReadKey(); } }}Thank you for help,Sibylle

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Entity Framework 5, code first: database created, then crash

2012-09-27 Thread Jiri Cincura
You have Migrations turned on, but Migrations are/is not supported (currently).

-- 
Jiri {x2} Cincura (x2develop.com founder)
http://blog.cincura.net/ | http://www.ID3renamer.com

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider