0

我正在使用 Silverlight 4 ria 服务和 sql server 2008,

我们使用存储过程返回一些我们在数据网格中显示的数据,当 issummary =0 我们使用相同的存储过程返回数据摘要,当 issummary =1

当 issummary =0 存储过程正在返回数据,但是当 issummary =1 时,它会抛出一个错误说

Results View = The type 'VSO.Models.Server.PFO' exists in both 'VSO.Web.dll' and 'DataContractSurrogates_451c5697-49be-4ec5-9d42-89486ff684a6'

在designer.cs 文件中。

以及 domainservice.cs 文件中的强制转换异常

指定的演员表无效。

展开:

  at System.Data.DataTableReader.GetGuid(Int32 ordinal)
   at System.Data.Linq.SqlClient.ObjectReaderCompiler.Rereader.GetGuid(Int32 i)
   at Read_PFO(ObjectMaterializer`1 )
   at System.Data.Linq.SqlClient.ObjectReaderCompiler.ObjectReader`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at VSO.DomainServices.Server.PFODomainService.PFOSelectByStores(String storeIds, Int32 filter, Int32 pageIndex, Int32 pageSize, Guid userId, String sortColumn, String productIDs, Boolean isSummary, Int32& totalRows) in C:\Hood_VSO\.VSO\.VSO.Web\Services\PFODomainService.cs:line 820

我哪里出错了,谁能帮我解决这个问题,非常感谢

4

1 回答 1

0

我找到了解决方案,没有。当summary 为0 时存储过程返回的列的数量大于no。当摘要为 1 时存储过程返回的列数,并且这些列也可以为空。

所以它抛出了一个演员表异常。

我为summary = 1 创建了一个新的存储过程。与要求。

于 2013-03-14T21:01:56.330 回答