【问题标题】:Error 4004 , with Silverlight 4 WCF RIA with Remote Database错误 4004,Silverlight 4 WCF RIA 和远程数据库
【发布时间】:2010-11-27 19:04:41
【问题描述】:

当我尝试使用 WCF RIA 为 silverlight 应用程序加载数据但出现错误时 如下。

消息:Silverlight 应用程序中出现未处理的错误

代码:4004

类别:ManagedRuntimeError

消息:System.ServiceModel.DomainServices.Client.DomainOperationException:查询的加载操作失败

我正在使用远程数据库,它正确地验证了用户,连接到数据库但数据绑定失败。代码:

    public MainPage()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainPage_Loaded);
        }

 void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            // create a context to the WCF RIA service and call the RIA service method
            // to get the list of all customers.
            var context = new ExpertIssueTracker.Web.ITDomainContext();
            dataGrid1.ItemsSource = context.IT_USERs;
            context.Load(context.GetIT_USERQuery());
        }

我尝试了 fiddler,但无法找出确切原因。在连接到远程托管数据库时我们有任何具体问题吗?

【问题讨论】:

  • WCF RIA 错误非常糟糕。每次我看到这条消息都是因为数据库连接字符串不正确。
  • 那有什么解决办法呢? connectionString="metadata=res://*/ITModel.csdl|res://*/ITModel.ssdl|res://*/ITModel.msl;provider=System.Data.SqlClient;provider 连接字符串="Data Source=**Source***;Initial Catalog=***DBNAME***;Persist Security Info=True;User ID=***DBNAME***;Password=***Password***;MultipleActiveResultSets=True” ;" providerName="System.Data.EntityClient" />

标签: silverlight-4.0 wcf-ria-services


【解决方案1】:

好的,我明白了,问题出在共享主机上。他们在 .Net4 beta 上运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-06-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多