I am currently working on a project where I want to create a database level for an Interbase database using the Entity Framework. The only thing I can not get it to work, so I appeal to my favorite SO-users.
I am currently using:
Visual Studio 2013 Premium
Interbase XE7 Developer Edition ( download here )
Entity Framework 6.1.2
Interbase ADO.NET Driver with Interbase XE7 Installation
In this example, I created a very simple database with only 1 table UserTypesthat contains IDand Description.
I wrote the following code to represent my model UserTypesand my context (which is really very simple):
public class MyContext : DbContext
{
public MyContext(DbConnection connection)
: base(connection, true)
{ }
public virtual DbSet<UserTypes> UserTypes { get; set; }
}
public class UserTypes
{
[Key]
public int ID { get; set; }
[StringLength(40)]
public string Description { get; set; }
}
In mine, MainI created the following code:
static void Main(string[] args)
{
TAdoDbxConnectionStringBuilder CnStrBuilder = new TAdoDbxConnectionStringBuilder()
{
User_Name = "SYSDBA",
Password = "masterkey",
DBHostName = "localhost",
Database = @"C:\Users.gdb",
DriverName = "Interbase"
};
DbConnection connection = new TAdoDbxInterBaseConnection();
connection.ConnectionString = CnStrBuilder.ConnectionString;
using (var context = new MyContext(connection))
{
Console.WriteLine("Showing all user types");
var query = from ut in context.UserTypes
orderby ut.ID
select ut;
foreach (var userType in query)
{
Console.WriteLine("{0}: {1}", userType.ID, userType.Description);
}
}
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
, , LINQ ProviderIncompatibleException. :
A null was returned after calling the 'get_ProviderFactory' method on a store provider instance of type 'Borland.Data.TAdoDbxInterBaseConnection'. The store provider might not be functioning correctly.
, , Embarcadero, Entity Framework. :
.
, Microsoft SQL Server, , , - .