1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] object does not contain a definition and no extension method accepting a first argument...

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 1, 2021.

  1. Stack

    Stack Membro Participativo

    i have CLS_Payment.css in my project and i defined below method

    public SqlCommand CallBackPage_Add_New_Payment()
    {
    var cmd = new SqlCommand();
    var fd = new farsidate1();
    fd.Get_Date_Time();
    cmd.CommandType = CommandType.StoredProcedure;
    cmd.CommandText = "CallBackPage_Add_New_Payment";
    cmd.Parameters.Add("@userid", SqlDbType.Int).Value = UserID;
    cmd.Parameters.Add("@payprice", SqlDbType.BigInt).Value = totalPrice.Replace(",", "").Replace(" ", "").Replace("ریال", "");
    cmd.Parameters.Add("@websitePrecent", SqlDbType.Int).Value = websitePrecent;
    cmd.Parameters.Add("@paydate", SqlDbType.NVarChar).Value = fd._Day.ToString() + " " + DateTime.Now.ToShortTimeString();
    cmd.Parameters.Add("@paysearchdate", SqlDbType.BigInt).Value = Convert.ToInt64(fd.Get_Date_String_Format().Replace("/", ""));
    return cmd;
    }


    but when i call this method like below

    md.ExecuteSQL(clsp.PaymentPage_Before_Payment());


    it give me this error


    object does not contain a definition and no extension method accepting a first argument of type object

    , but this code is logical true but i dont khow where is my problem

    Continue reading...

Compartilhe esta Página