是否有可能查询多个数据库与WCF数据服务? [英] Is it Possible to Query Multiple Databases with WCF Data Services?

查看:250
本文介绍了是否有可能查询多个数据库与WCF数据服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的数据插入到同一模式的多个数据库。在多个数据库性能方面的原因存在。

I have data being inserted into multiple databases with the same schema. The multiple databases exist for performance reasons.

我需要创建一个客户端可以用它来查询数据库的WCF服务。然而,从客户端查看的点,只有1个数据库。我的意思是,当一个客户端执行查询,应该查询所有数据库,并返回组合的结果。

I need to create a WCF service that a client can use to query the databases. However from the client's point of view, there is only 1 database. By this I mean when a client performs a query, it should query all databases and return the combined results.

我还需要提供灵活的客户端来定义自己的查询。因此,我期待到WCF数据服务,它提供了指定的客户端的查询非常好的功能。

I also need to provide the flexibility for the client to define its own queries. Therefore I am looking into WCF Data Services, which provides the very nice functionality for client specified queries.

迄今为止,似乎对DataService只能使查询到单个数据库。我发现没有覆盖,让我派遣查询到多个数据库。

So far, it seems that a DataService can only make a query to a single database. I found no override that would allow me to dispatch queries to multiple databases.

有谁知道这是可能的WCF数据服务查询对多个数据库具有相同的架构?

Does anyone know if it is possible for a WCF Data Service to query against multiple databases with the same schema?

推荐答案

<一个href="http://social.msdn.microsoft.com/Forums/en-US/dataservices/thread/adfaa1ae-6b24-48c1-baf5-8cf19de59b4a"相对=nofollow>我张贴的问题在MSDN论坛并发现它需要很多的努力。

I posted the question on the MSDN forums and found out that it will require a lot of effort.

它涉及创建自己的数据服务提供商,这是棘手的,可以是一个大量的工作。最重要的是合并的结果与排序+分页将是一个任务,那就是过于复杂和危险的东西,我愿意做顶。例如,我怎么查询1000页排序名称列多个数据库?我将基本上必须从所有数据库中查询所有数据,按名称排序,然后选择第1000页。

It involves creating your own data service provider, which is tricky and can be a lot of work. On top of that merging results with sorting + paging will be a task that is far too complicated and risky for what I am willing to do. For example, how do I query multiple databases for page 1000 sorted by the Name column? I would essentially have to query all data from all databases, sort by Name, then select the 1000th page.

这篇关于是否有可能查询多个数据库与WCF数据服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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