protected void btnAdd_Click(object sender, EventArgs e)
{
if (!string.IsNullOrWhiteSpace(Request.QueryString["id"]))
{
string kundeID = "-1";
int id = Convert.ToInt32(Request.QueryString["id"]);
int totalsum = Convert.ToInt32(ddlAmount.SelectedValue);
Handlevogn handlevogn = new Handlevogn
{
TotalSum = totalsum,
KundeID = kundeID,
Dato = DateTime.Now,
ErIHandlevogn = true,
ProduktID = id
};
HandlevognModell modell = new HandlevognModell();
lblResult.Text = modell.InsertHandlevogn(handlevogn);
}
Run Code Online (Sandbox Code Playgroud)
不断收到错误
无法将 typre 'string' 隐式转换为 'short'
对于局部变量 kundeID。
c# ×1