我稱與參數的存儲過程,但它示出了一個錯誤存儲的過程「過程或函數‘Dlete_Selected’預計參數‘@id’,但未提供該」
過程或函數' Dlete_Selected」預計參數 '@id',但未提供
這是我的存儲過程:
CREATE procedure [dbo].[Delete_Selected]
(@id bigint)
AS
DELETE FROM Properties
WHERE Id = @id
這是我的代碼:
protected void btnDeleteSelected_Click(object sender, EventArgs e)
{
Button btn = (Button)sender;
cmd.CommandText = "Delete_Selected";
cmd.Parameters.AddWithValue("@id", Request.QueryString["id"]);
cmd.Parameters.Clear();
DataTable dtb = dboMrk.GetDataTableFrmDB(cmd);
if (dtb.Rows.Count > 0)
{
dtlstdata.DataSource = dtb;
dtlstdata.DataBind();
}
}
的可能的複製[存儲過程或函數需要參數未供給(http://stackoverflow.com/questions/19703653/stored-procedure-或功能期望參數,哪些不是提供) – VDWWD
或http://stackoverflow.com/questions/368642/procedure-expects-parameter-which-was-n- supplied – VDWWD
cmd.Parameters.Clear( );刪除這個,也請把值轉換爲大整數 –