求教:xbap 如何取到数据库中的数据?

smilingday 2007-11-08 02:45:13
各位大侠:近期我要开发一个应用,想采用wpf/E(wpf浏览器应用程序或XBAP应用程序)开发,目前需要取得数据库中的数据来显示到web上,我试过在xbap中直接连接数据库可是不成功提示:请求“system.data.sqlclient.sqlclientpermission, system.data, version=2.0.0.0, culture=neutral, publickeyToken=b77a5c561934e089”类型的权限已失败
我认为是web应用程序遇到安全限制无法直接访问数据库(如果我分析的不对,有方法解决,请不吝赐教,万分感谢!)
于是我考虑采用通过WCF服务访问数据库,然后通过xbap调用服务来获得数据库的数据但是由于这样的问题,提示如下:验证名称为 WSHttpBinding 的绑定失败,因为它包含类型为 System.ServiceModel.Channels.SymmetricSecurityBindingElement 的 BindingElement,而其在部分信任中不受支持。请考虑使用 BasicHttpBinding 或 WSHttpBinding,或者将您的应用程序寄宿在完全信任的环境中。
我不知如何处理?目前我的需求是xbap 如何取到数据库中的数据,但是上面两种方法都没成功,请各位大侠如果知道上面方案中的处理方法,给个提示,或者给出其它方法可以解决问题的方法。在此感谢各位!!!
...全文
471 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
Lxpd 2011-11-01
  • 打赏
  • 举报
回复
使用 WCF 数据服务 可以解决你的问题
wk99239 2011-09-20
  • 打赏
  • 举报
回复
要通过webservice访问数据,请先添加web引用
ijwsoft 2008-12-20
  • 打赏
  • 举报
回复
俺也期待解决
内Cool超人 2008-11-20
  • 打赏
  • 举报
回复
http://blog.csdn.net/jacle169/archive/2008/11/18/3322753.aspx
  • 打赏
  • 举报
回复
在项目属性的安全性里 选择这是完全可信的应用程序
ms44 2008-06-27
  • 打赏
  • 举报
回复
这个可以帮你。
http://blogs.msdn.com/shawnfa/archive/2003/06/26/57026.aspx
Jeremiah 2008-05-22
  • 打赏
  • 举报
回复
用webservice.

如果你的webservice的地址是 http://localhost/WebService/Server.asmx
那么你的xbap的网站发布的时候,地址也应该在http://localhost/WebService/ 下.


UltraBejing 2008-05-01
  • 打赏
  • 举报
回复
我也想知道,正在找這方面的資料~~~~~
smilingday 2007-11-13
  • 打赏
  • 举报
回复
http://blog.csdn.net/jackjoy/archive/2007/07/09/1683968.aspx
wangsaokui 2007-11-09
  • 打赏
  • 举报
回复
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1295502&SiteID=1

XBAPs can make WebRequests only to the site-of-origin. If you are using http:// URLs, this usually means the domain must be the same. For file://, the SOO is the full path from which the XBAP is deployed. This means it can access other resources only under that path. To enable local debugging (with just F5 in VS), you can try to specify the DebugSecurityZoneURL to be something that covers both the web service and the XBAP's debug location.

If this doesn't help, please post a callstack with the security exception.
smilingday 2007-11-09
  • 打赏
  • 举报
回复
xbap如何调用 Web Service 请给个说明,在xbap应用中无法找到添加web引用的项???谢谢!!!!!
smilingday 2007-11-08
  • 打赏
  • 举报
回复
为什么我调用webservice也提示错误呢?
请求“System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089”类型的权限已失败。
请大侠给个提示?
cxx1997 2007-11-08
  • 打赏
  • 举报
回复
http://blog.joycode.com/sunmast/archive/2007/05/08/xbap_deployment.aspx

XBAP (UI Layer) <-> Web Service (Business Layer) <-> Database

13,347

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET技术前瞻
社区管理员
  • .NET技术前瞻社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧