删除行将显示错误“输入字符串的格式不正确”。

时间:2019-03-08 12:52:27

标签: c# asp.net stored-procedures

protected void BtnDelete_Click(object sender, EventArgs e)
    {

        if (sqlCon.State == ConnectionState.Closed)
            sqlCon.Open();
        SqlCommand sqlCmd = new SqlCommand("EmployeeDeleteById", sqlCon);
        sqlCmd.CommandType = CommandType.StoredProcedure;
        sqlCmd.Parameters.AddWithValue("@EmpId", Convert.ToInt32(hfEmpDetails.Value));
        sqlCmd.ExecuteNonQuery();
        sqlCon.Close();
        Clear();
        fillGridView();
        lblSuccessMessage.Text = "Deleted Successfully";
    }

0 个答案:

没有答案