过程或函数需要没有提供的参数,即使它是?
Procedure or Function expects parameter which is not supplied even though it is?
不确定我是否调用不正确,但我收到一条错误消息,说我没有提供参数。我尝试使用 LINQ to SQL 执行存储过程,如下所示:
Context.ExecuteQuery(returnType, "EXEC [GetResults]", new object[] {StoredProcName});
我也试过这样调用它,但它给了我一个语法错误(因为 SP 在另一个数据库中,我必须提供全名):
Context.ExecuteQuery(returnType, string.Format("EXEC [GetResults]{0}", storedProcName));
StoredProcName 设置为此值:[DevDB].[Services].[GetTypes]
这样传不行吗?
哇我才明白,我现在觉得真的很傻。我读错了函数定义。
应该这样称呼:
Context.ExecuteQuery(returnType, "EXEC [GetResults]{0}", storedProcName);
不确定我是否调用不正确,但我收到一条错误消息,说我没有提供参数。我尝试使用 LINQ to SQL 执行存储过程,如下所示:
Context.ExecuteQuery(returnType, "EXEC [GetResults]", new object[] {StoredProcName});
我也试过这样调用它,但它给了我一个语法错误(因为 SP 在另一个数据库中,我必须提供全名):
Context.ExecuteQuery(returnType, string.Format("EXEC [GetResults]{0}", storedProcName));
StoredProcName 设置为此值:[DevDB].[Services].[GetTypes]
这样传不行吗?
哇我才明白,我现在觉得真的很傻。我读错了函数定义。 应该这样称呼:
Context.ExecuteQuery(returnType, "EXEC [GetResults]{0}", storedProcName);