开发者

Error when calling SQL SP via LINQ

Newbie problem: I have a SQL SP with ten parameters (eight input, two output) but when I attempt to call it via LINQ from code I get the following error message:

"The be开发者_JAVA技巧st overloaded method match for 'DataClassesDataContext.ST_CR_CREATE_CASE_BASIS(string, string, string, string, System.DateTime?, string, string, string, ref int?, ref int?)' has some invalid arguments".

The params with ? appear to be unrecognized, but I'm baffled: the data types match the SQL types, the number of parameters match, the other parmeters don't exhibit the same behaviour. Can anyone tell me what's going on? Thanks in advance.

-- SQL SP:

create procedure ST_CR_CREATE_CASE_BASIS

@p_Pers_No      nvarchar (50),
@p_Subject      nvarchar (255),

@p_RQ_XML       nvarchar(max),
@p_RQ_XSL       nvarchar(max),
@p_Date_Submit      smalldatetime,
@p_User_ID_Submit   nvarchar (255),
@p_RQ_Status        nvarchar (50),
@p_User_ID_OnBehalf     nvarchar (255),

@p_Case_Number      int output,
@p_RQ_ID        int output

as
begin

 -- ... etc.; the SP works fine when called from SSMS

The code-behind proc from the aspx page looks like this:

protected void cmdSubmit_Click(object sender, EventArgs e)
{

    using (DataClassesDataContext vDataCont = new DataClassesDataContext())
    {
        Int32 vNewCaseNr;
        Int32 vNewReqNr;
        DateTime vNow = System.DateTime.Now;

        vDataCont.ST_CR_CREATE_CASE_BASIS("101", "Test Subject Late Wed", null, null, vNow , "101", "1", "101", ref vNewCaseNr, vNewReqNr);
     }

}


using (DataClassesDataContext vDataCont = new DataClassesDataContext())
    {
        int? vNewCaseNr;
        int? vNewReqNr;
        DateTime vNow = System.DateTime.Now;

        vDataCont.ST_CR_CREATE_CASE_BASIS("101", "Test Subject Late Wed", null, null, vNow , "101", "1", "101", ref vNewCaseNr, ref vNewReqNr);
     }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜