我正在制作一项Web服务以将数据插入ASP.NET C#和VS-2017中的数据库中 在运行我的网络服务并单击“调用”按钮后,它给出了错误: HTTP404。您正在寻找的资源(或其依赖项之一)可能已被删除,名称更改或暂时不可用。请查看以下网址,并确保其拼写正确。
[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;
}