当它从SSMS正确运行时,它应该返回大约30行.
我尝试了几种不同的方法从代码调用过程,但每次都有相同的结果.这刚刚开始发生,昨天它工作正常.
为我们调用该过程的首选方法是使用Linq2sql,它给出以下错误消息:
Timeout expired. The timeout period
elapsed prior to completion of the
operation or the server is not
responding. Description: An unhandled
exception occurred during the
execution of the current web request.
Please review the stack trace for more
information about the error and where
it originated in the code.Exception Details:
System.Data.sqlClient.sqlException:
Timeout expired. The timeout period
elapsed prior to completion of the
operation or the server is not
responding.Source Error:
Line 16: public IMultipleResults GetTournamentRatingNonComplaintData([global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "DateTime")] System.Nullable<System.DateTime> startdate,[global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "DateTime")] System.Nullable<System.DateTime> enddate,[global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Int")] System.Nullable<int> officialSportID,[global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Char(1)")] System.Nullable<char> gender,[global::System.Data.Linq.Mapping.ParameterAttribute(DbType = "Int")] System.Nullable<int> level) Line 17: { Line 18: IExecuteResult result = this.ExecuteMethodCall(this,((MethodInfo)(MethodInfo.GetCurrentMethod())),startdate,enddate,officialSportID,gender,level); Line 19: return ((IMultipleResults)(result.ReturnValue)); Line 20: }
解决方法
例如,请参阅sql Management Studio工具/选项/查询执行/ sql Server / Advanced中默认设置的选项.
我怀疑这两种环境之间的某些设置不同会导致您的问题.要进行调试,您应该尝试将sql Server Management Studio配置为在运行SP之前使用与.NET连接字符串相同的配置.
或者,将SET语句添加到.NET查询中以配置您在Management Studio中配置的所有选项.
找到不同的设置并不总是很容易 – 根据我的经验,一个常见的原因是不同的ANSI设置.