System.InvalidOperationException: Missing parameter: AracMarka.
at System.Web.Services.Protocols.ValueCollectionParameterReader.Read(NameValueCollection collection)
at System.Web.Services.Protocols.HttpServerProtocol.ReadParameters()
at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
我的WebMethot的参数可以在我的电脑上使用。我写了一些东西并作出回应,但是我将Web服务工作上传到服务器,但是当ı调用metod并向其中写入时,会出现错误Missing Parameter
我的PC本地服务器,服务器和代码
[WebMethod]
public Bilgiler GetBilgiForMarka(String AracMarka, String AracModel, String Motor)
{
string a = "Data Source=.;Initial Catalog=Android;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFramework";
Bilgiler bilgilerimiz = new Bilgiler();
SqlConnection conn = new SqlConnection(a);
SqlCommand command = new SqlCommand("SELECT ID FROM [Android].[dbo].[KitAracModel] WHERE AracMarka='" + AracMarka + "' AND AracModel='" + AracModel + "' AND Motor='" + Motor + "'");
command.Connection = conn;
conn.Open();
int ax = (int)command.ExecuteScalar();
conn.Close();
using (SqlConnection con = new SqlConnection(a))
{
SqlCommand cmd = new SqlCommand("SP_BILGILERIGET", con);
cmd.CommandType = System.Data.CommandType.StoredProcedure;
SqlParameter parametre = new SqlParameter();
parametre.ParameterName = "@ID";
parametre.Value = ax;
cmd.Parameters.Add(parametre);
con.Open();
SqlDataReader DR = cmd.ExecuteReader();
while (DR.Read())
{
bilgilerimiz.ID = Convert.ToInt32(DR["ID"]);
bilgilerimiz.AracMarka = DR["AracMarka"].ToString();
bilgilerimiz.AracModel = DR["AracModel"].ToString();
bilgilerimiz.Motor = DR["Motor"].ToString();
bilgilerimiz.Silindir = DR["Silindir"].ToString();
bilgilerimiz.Guc = DR["Guc"].ToString();
bilgilerimiz.KitAd = DR["KitAd"].ToString();
bilgilerimiz.KitNo = DR["KitNo"].ToString();
}
}
return bilgilerimiz;
}