Entity Framework 4 and DB2: database generation error -


We are using Entity Framework 4 RC on Visual Studio 2010 with DB2 version 9.7.3.4. I also have VS add-ins and can see the DB2 database in server explorer. I have created a very simple VS console project and it works fine against SQL Server, so I know it's valid. I have references to "IBM.Data.DB2.9.7.3" and "IBM.Data.DB2.Entity" in my project.

In the app. My connection string is:

  & lt; Name = = "productcontact" provider name = "IBM data .db2" connection string = "database = db2 test; user id = XXXX; pwd = XXXX; server = XXXX; continue security information = true;" / Gt;   

The first statement of my code is a database launcher:

  DbDatabase.SetInitializer  (New DropCreateDatabaseIfModelChanges  () ;   

During the run-time, when I reach a line that causes data change, I get an error:

Model Compatibility Can not check because the database does not have model metadata.

Because I requested that the database be abandoned, it is not a logical error, does anyone know what the reason might be?

I will first try to get from CreateDatabaseIfNotExists, which will add the AdmittataData table for schema. I believe the error is that EF is saying that he can not get that table. <> DbDatabase.SetInitializer & product;

Run it once, then once you have the AdmitTata table, make changes to DropCreateDatabaseIfModel.

Comments