I am making a web-service to insert data in database in asp.net c# and VS-2017 and after running my web-service and on click of invoke button it gives error: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

[WebMethod]
public int InsertClients(string sClientName, int nShippingId, string sEmailId, string sMemoMail, string sClientCode)
{
    int retRecord = 0;

    using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConString"].ConnectionString))
    {
        using (SqlCommand cmd = new SqlCommand("sp_ClientDetails", con))
        {
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("sClientName", SqlDbType.VarChar, 100).Value = sClientName;
            cmd.Parameters.Add("nShippingId", SqlDbType.VarChar, 100).Value = nShippingId;
            cmd.Parameters.Add("sEmailId", SqlDbType.VarChar, 100).Value = sEmailId;
            cmd.Parameters.Add("sMemoMail", SqlDbType.VarChar, 100).Value = sMemoMail;
            cmd.Parameters.Add("sClientCode", SqlDbType.VarChar, 100).Value = sClientCode;
            if (con.State != ConnectionState.Open)
            {
                con.Open();
            }
            retRecord = cmd.ExecuteNonQuery();
        }
    }
    return retRecord;
}

0 Answers