0

I edited my stored procedure to only accept 1 input value. It used to accept 2 but I made my other stored procedure perform the task so now proc_CsStatus() only accepts 1 parameter. However, I get the error:

    No overload for method 'proc_CsStatus' takes 1 arguments    

I thought by removing the parameter and also anything related to the parameter, the problem would be fixed. proc_CsStatus only takes one parameter now.

    public static int GetCsStatus()
    {
        using (Entities db = new Entities())
        {
            int Timeout = int.Parse((from stat in db.Messenger_Settings
                                     where stat.SettingName == "CSTimeout"
                                     select stat.SettingValue).SingleOrDefault().Trim());

            System.Data.Objects.ObjectParameter s = new System.Data.Objects.ObjectParameter("status", typeof(int));
            int r = db.proc_CsStatus(Timeout,s);
            return (int)s.Value;
        }
    }

to:

    public static int GetCsStatus()
    {
        using (Entities db = new Entities())
        {
            System.Data.Objects.ObjectParameter s = new System.Data.Objects.ObjectParameter("status", typeof(int));
            int r = db.proc_CsStatus(s);
            return (int)s.Value;
        }
    }
4

1 回答 1

1

刷新你的edmx. 您创建了存储过程,但它在您的代码库中没有更改。更新您的代码 ( edmx),错误就会消失。

于 2013-09-17T19:07:06.360 回答