具有本地数据选项的 Silverlight 4 OOB

发布于 2024-09-25 10:47:57 字数 496 浏览 7 评论 0原文

现在我有一个带有 SQL Server 后端的 Winform 应用程序。 DAL 由 Linq to SQL 组成。该应用程序的复杂性之一是它需要离线运行。

我通过使用合并复制来保持本地 SQL Express 实例与中央 SQL Server 同步来完成此任务。我有一些逻辑可以检测连接状态并适当地切换 contexts 连接字符串。

我的问题是,这也适用于 Silverlight 4 吗?理论上,我会检测它们何时离线并适当地切换连接。想法?


编辑

看来这实际上是可能的。请参阅此处

我现在想了解的是,我是否可以使 EFL2S 与此一起使用,而不是像它所示的 RecordSets 那样。

Right now I have a Winform app with a SQL Server back end. The DAL is comprised of Linq to SQL. One of the complexities of this app is it's need to function offline.

I have accomplished this by using Merge Replication to keep there local SQL Express instances in sync with a central SQL Server. I have some logic that detects there connection state and switches the contexts connection string appropriately.

My question is thus, will this also work with Silverlight 4? In theory, I would detect when they are offline and switch the connection appropriately. Thoughts?


EDIT

It seems this is, in fact, possible. See HERE.

What I NOW would like to understand is if I could make EF or L2S work with this instead of RecordSets like it shows.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

指尖上的星空 2024-10-02 10:47:57

对于 Silverlight(任何版本),问题不在于与数据库的连接。在 Silverlight 中,您没有它。您唯一能做的就是回调发出请求的服务器。

因此,您必须运行某种本地 IIS 实例并连接到该实例,然后该实例又会连接到本地 SQL 实例。

问题是,如果您的 SL 应用程序是从您的站点加载的,然后连接丢失,您的应用程序将无法检测到它。您必须转到本地计算机上服务器的新链接,然后在再次建立连接时让它们切换回来。

对于这样的事情,最好坚持使用 Winforms 应用程序并确定那里是否有连接。这样,您就可以在没有连接时切换所访问的数据库。

With Silverlight (any version) the problem isn't so much connectivity to the database. In Silverlight, you don't have it. The only thing you can do is make a call back to the server that the request originated from.

Because of this, you would have to have some sort of local IIS instance running and connect to that, which would then in turn connect to the local SQL instance.

The thing is, if your SL application was loaded from your site, and then connectivity was lost, your app couldn't detect it. You would have to go to a new link to the server on the local machine and then have them switch back when they have connectivity again.

For something like this, it's probably best that you stick with the Winforms app and determine whether or not you have connectivity there. That way, you can switch which database you hit when you don't have connectivity.

樱&纷飞 2024-10-02 10:47:57

casperOne 的意思是,浏览器外的 Silverlight 无法访问客户端上完整的数据库。最好的办法是在独立存储中或在 Silverlight 4 的少数可访问文件夹之一中使用某种紧凑数据库。我个人使用 siaqodb.com ,但您必须手动保持数据同步(这可能是一场噩梦)。

最近,我看到有人访问 SQL 紧凑型数据库。然而,现在可能有更多访问数据的方式。我已经有一段时间没有寻找 Silverlight 的客户端数据库了。

What casperOne is saying is that out of browser Silverlight does not have access to a full fledged database on the client. The best that can be done is to use some sort of compact database either in the isolated storage or within one of the few accessible folders with Silverlight 4. I have personally used siaqodb.com , but you will have to keep the data synchronized manually (which can be a nightmare).

More recently I have seen someone get access to a SQL compact database. However, there could be more ways of accessing data now. It has been some time since I've looked for a client side database for Silverlight.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文