实体框架和链接服务器 [英] Entity Framework and Linked Servers

查看:75
本文介绍了实体框架和链接服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个访问数据库,它是SQL Server中的链接服务器。对于访问数据库中的每个表,我创建了一个映射到我的entites的视图。查询工作完美,但插入结果会出现以下错误:
由于OLE DB提供程序"Microsoft.Jet.OLEDB.4.0",因此无法执行请求的操作。对于链接服务器"XXX"不支持所需的事务接口。

我理解这是因为分布式事务。但是有没有可能使这个工作?

沃尔夫冈·罗斯勒

解决方案

可能没有。

唯一的我能想到的是为视图编写CLR而不是插入/更新和删除触发器并编写代码以在C#或其他东西中手动更新Access数据库
可能不是一个很好的解决方案,因为你会必须选择退出交易支持等。

但你可能想考虑尝试一下吗?

希望这有助于亚历克斯

I have an access database which is a linked server in SQL Server. For each table in the access database I have created a view which is mapped to my entites. Querying works perfectly, but inserting results in the following error:
The requested operation could not be performed because OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "XXX" does not support the required transaction interface.

I understand that this because of the distributed transactions. But is there any possibility to get this working?

Wolfgang Roessler

解决方案

Probably not.

The only thing I can think of is to write CLR instead of insert / update and delete triggers for the view and write the code to update the Access Database manually in C# or something

Probably not a great solution because you would be necessarily opting out of transaction support etc.

But you might want to consider giving this a try?

Hope this helps
Alex


这篇关于实体框架和链接服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆