【发布时间】:2010-11-29 22:00:06
【问题描述】:
我知道了,它在我的 MS SQL 2008 数据库中调用了一个 SP:
[Function(Name = "dbo.Content_GetContent")]
[ResultType(typeof(Content_GetContentResult))]
[ResultType(typeof(Content_GetContentImagesResult))]
[ResultType(typeof(Content_GetContentBoxesResult))]
[ResultType(typeof(Content_GetContentSearchWordsResult))]
public IMultipleResults GetContent([Parameter(DbType = "INT")]int? contentID)
{
IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), contentID);
return ((IMultipleResults)(result.ReturnValue));
}
但是我遇到了 2 个问题,不是每个表都可能返回结果,如果提供的 contentID 不正确(不是有效的内容编号),那么它会失败并生成以下错误: “为不返回 IMultipleResults 的函数 'GetContent' 声明了多个结果类型。”
有什么办法解决这个问题吗?
【问题讨论】:
标签: c# sql-server linq-to-sql stored-procedures select