Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/arduino/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从SQL数据库加载多行时出现Silverlight错误_Silverlight_Sql Server 2008_Entity Framework_Domainservices_Basichttpbinding - Fatal编程技术网

从SQL数据库加载多行时出现Silverlight错误

从SQL数据库加载多行时出现Silverlight错误,silverlight,sql-server-2008,entity-framework,domainservices,basichttpbinding,Silverlight,Sql Server 2008,Entity Framework,Domainservices,Basichttpbinding,我有一个Silverlight应用程序,它是用Entity Framework 4构建的,一堆Silverlight模块和一个Web项目,其中包含我的DomainService、Model和Web.Config 我从本地SQL Server中提取数据,该服务器工作正常。我的一个SL模块从一个特定的表中提取数据,当我在这个表中有4000多行时,应用程序崩溃并给出以下错误消息。当它有大约1000个鱼卵时,它就可以正常工作了。 所以,我想也许DomainService不能处理所有的行,或者我在webc

我有一个Silverlight应用程序,它是用Entity Framework 4构建的,一堆Silverlight模块和一个Web项目,其中包含我的DomainService、Model和Web.Config

我从本地SQL Server中提取数据,该服务器工作正常。我的一个SL模块从一个特定的表中提取数据,当我在这个表中有4000多行时,应用程序崩溃并给出以下错误消息。当它有大约1000个鱼卵时,它就可以正常工作了。 所以,我想也许DomainService不能处理所有的行,或者我在webconfig中的绑定设置在某种程度上是错误的。。我能做什么

错误消息:

{System.ServiceModel.DomainServices.Client.DomainOperationException:查询“LoadSiteCageData”的加载操作失败。远程服务器返回错误:NotFound。-->System.ServiceModel.CommunicationException:远程服务器返回错误:NotFound。-->System.Net.WebException:远程服务器返回错误:NotFound。-->System.Net.WebException:远程服务器返回错误:NotFound。 位于System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult) 在System.Net.Browser.BrowserHttpWebRequest.c_DisplayClass5.b_4(对象发送状态)中 在System.Net.Browser.AsyncHelper.c_DisplayClass4.b_0中(对象发送状态) ---内部异常堆栈跟踪的结束--- 位于System.Net.Browser.AsyncHelper.BeginNoui(SendOrPostCallback beginMethod,对象状态) 位于System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult) 位于System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelAsyncRequest.CompleteTresponse(IAsyncResult结果) ---内部异常堆栈跟踪的结束--- 位于System.ServiceModel.DomainServices.Client.WebDomainClient`1.EndQueryCore(IAsyncResult asyncResult) 位于System.ServiceModel.DomainServices.Client.DomainClient.EndQuery(IAsyncResult asyncResult) 位于System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) ---内部异常堆栈跟踪的结束--- 位于System.ServiceModel.DomainServices.Client.OperationBase.Complete(异常错误) 位于System.ServiceModel.DomainServices.Client.LoadOperation.Complete(异常错误) 位于System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult) 位于System.ServiceModel.DomainServices.Client.DomainContext.c_DisplayClass1b.b_17(对象)

Web.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
    <sectionGroup name="system.serviceModel">
        <section name="domainServices" type="System.ServiceModel.DomainServices.Hosting.DomainServicesSection, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" allowDefinition="MachineToApplication" requirePermission="false" />
    </sectionGroup>
</configSections>
<appSettings />
    <system.web>

    <httpModules>
                <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
        <assemblies>
            <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        </assemblies>
    </compilation>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">

    </pages>

    <authentication mode="Windows" />

</system.web>
<system.codedom></system.codedom>

<system.webServer>
    <modules>
                <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <bindings>
        <customBinding>
            <binding name="MyService.Web.Service1.customBinding0">
                <binaryMessageEncoding />
                <httpTransport />
            </binding>
        </customBinding>
    </bindings>
    <services>
        <service name="MyService.Web.Service1">
            <endpoint address="" binding="customBinding" bindingConfiguration="MyService.Web.Service1.customBinding0" contract="MyService.Web.Service1" />
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        </service>
    </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>


我认为这是由于只要涉及basichttpbinding,就可以通过导线传输的数据大小的限制。它是64k

有两种方法可以解决这个问题

  • 逐页拉取数据
  • 将数据下载为逗号分隔的文件,解析并显示

我通常做的是将数据下载为zip文件,在客户端解压,然后处理如此大量的数据。

您可以发布您的配置,特别是端点规范吗?默认情况下有大小限制(64kb?)到消息。您需要增加。我已经在最初的帖子中添加了webconfig,请帮助:)我无法通过分页来完成此操作,因为我正在提取的所有数据都被绘制在一个图表中。因此Zip也不是一个替代方案。您仍然可以分页数据。要执行此操作,您需要一次检索50条左右的记录。一旦所有记录都关闭加载后,你可以将它们绘制到你的图表中。我对这些概念相当陌生,所以现在我不清楚我应该怎么做。所以,基本上我在寻找这个问题上的qucik修正-如果有某种缓冲区等,我可以增加。