- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
目前我正在做一个项目,我想使用 Entity Framework 为 Interbase 数据库创建一个数据库层。唯一的问题是我无法让它工作,所以我求助于我亲爱的 SO 共同用户。
我目前正在使用:
Visual Studio 2013 高级版
Interbase XE7 开发者版(download here)
Entity Framework 6.1.2
Interbase ADO.NET 驱动程序随 Interbase XE7 安装提供
对于这个例子,我创建了一个非常简单的数据库,只有 1 个表 UserTypes
其中包含 ID
和一个 Description
.
我编写了以下代码来表示我的 UserTypes
模型和我的上下文(这确实非常基础):
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; }
}
在我的 Main
内我编写了以下代码:
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();
}
不过,当我运行应用程序时 ProviderIncompatibleException
在执行 LINQ 查询时抛出。异常具有以下消息:
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提供的provider不提供对Entity Framework的支持。所以我的问题如下:
Interbase ADO.NET 驱动程序是否提供对 Entity Framework 的支持?还是我做错了什么?
是否可能有任何其他驱动程序支持我所需的功能?
非常感谢有关此主题的任何帮助。
我在使用成功运行的 Microsoft SQL Server 数据库时也尝试了相同的代码,因此我认为我的代码通常没有任何问题。
最佳答案
据我所知,EF不支持连接Interbase数据库。但是,应该可以根据 EF 的指南编写您自己的提供程序,该指南可在 here 中找到。 .
首先,您可能想看看 FireBird 提供程序(它是开源的)并且已经在使用 EF。如果您研究提供的代码,您可能会很好地触发为 EF 编写您自己的 Interbase 提供程序。可以找到指向 FireBirds EF .NET Provider 的链接 here
关于c# - Interbase XE7 和 Entity Framework 6.1.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28106283/
我有一个 Interbase 5.5 数据库(注意:这是一个非常旧的版本,来自上个千年)。 到目前为止,我已经成功使用 Delphi 附带的“ native ”Interbase 组件(IBDatab
我尝试关注http://edn.embarcadero.com/article/28604用于重新启动 Interbase。这是一些代码: program IBRestart; {$APPTYPE C
我们有一个数据库,我们的客户端是用Delphi 2007写的,用的是最新的Interbase 2009。数据库很旧,我相信它是在 2002 年左右创建的,现在已经超过 25 GB。最近发现在IBCon
如果将 Firebird 安装到已安装 Interbase 的系统上,是否会产生冲突。我看到有人提到使用相同的端口、路径添加以及 ISQL.exe 中的通用程序名称作为命令处理器。我看到引用 FB 版
(Interbase ToGo 是 InterBase sql 数据库的嵌入式版本。) 我正在通过从 Windows 7 应用程序访问它来对 InterBase ToGo 进行简单评估。但是,当我运行
我有一个来自 interbase7.1 的 .gdb 格式的备份文件。我在自己的机器上安装了interbase server,版本是xe7。我打开了 ibconsole.exe 应用程序。试图用上述备
我即将开始以适当的方式重做公司数据库。我们当前的数据库一团糟,几乎没有文档。我想知道人们在设计 Interbase 数据库时推荐使用什么?是否有某种好的视觉模式设计器可以生成 SQL?全部手工完成是否
作品 select payeeid, EXTRACT(WEEKDAY FROM checkdate) as DOW, (bankcleared - checkdate) as DateDiff fr
我的一位客户拥有一个不存在的旧应用程序;他与制作该应用程序的公司有问题,他们不会透露他的数据库密码。他意识到他签署了一份契约(Contract)(当时),其中说他是在“租用”该应用程序,他们无权透露任
我正在尝试使用 jdbc 连接到旧版 interbase 数据库,这是我的代码 try { Class.forName("interbase.interclient.Driver");
我让我的 RadStudio 设置正常工作,并为 android 创建了一个非常简单的移动应用程序,它使用 IBLite 来获取一些数据。出于商业原因,我不得不离开这个项目并转向其他事情。所以我回到
其实我的问题很简单:在 C# 中是否支持 Interbase 事件?在 Delphi 中有 TIBEvent 类,但我找不到用于 C# 的此类东西。 我唯一能想到的是直接使用 GDS32 dll 或自
我有一个遗留系统需要维护,在生产环境中这个系统运行正常,但在我的开发机器上我无法连接到数据库。我的操作系统是 Ubuntu 14.04,全新安装了 firebird2.5-classic,php 版本
我制作了一个在网络环境下访问 firebird 数据库的程序。 我通常在网络的两个不同点通过网络访问数据库。 但是如果我同时打开这两个程序,这个异常会在第二个程序上抛出,它试图连接到数据库: “您的用
我有以下问题 SELECT * FROM ( select distinct r1.rep_code,
我知道我可以在应用程序中使用 TIBEvents 对象来接收发布的事件 通过使用 POST_EVENT 的 Interbase 服务器。 通过在 IB 数据库上设置触发器,我可以使用这种机制来获取通知
这是我将用户添加到 Interbase 安全数据库的 Delphi 代码 uses IBHeader,IBExternals var Form7: TForm7; userData: TU
我有一个扩展名为 .ib 的文件。我猜测它是 Interbase 或 Firebird 文件,但我无法确定到底是哪个文件。此外,尚不清楚到底是使用 Interbase(或 Firebird)的哪个版本
Interbase 是一个分代数据库。 这很好,因为回滚几乎是瞬时的,但是 count(*)需要永远。 这是不像 例如MySQL where count 可以使用索引。 我一直不知道为什么,直到我看到
我正在尝试将 Interbase 连接池添加到 GlassFish v3 在项目中使用 EJB 3.1。 glassfish 日志似乎正确连接到我的数据库,它输出了我所有的表名和索引。但是,我收到错误
我是一名优秀的程序员,十分优秀!