0
하나 이상의 필수 매개 변수에 대해 No 값이 지정되었습니다. C# 업데이트 데이터베이스를 업데이트하려고 시도한 곳에서 코드가 있습니다. 누군가 내 조수가 될 것입니다.C# 업데이트 쿼리
private void updatebutton_Click(object sender, EventArgs e)
{
try
{
con.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = con;
string query = "update Emplyeedata set [ID]='" + midbox.Text + "',[Name]='" + mnamebox.Text + "',[Deisgnation]='" + mdesbox.Text + "',[Leave]='" + mleavebox.Text + "'Where [Name]='"+mnamebox.Text+"'";
cmd.CommandText = query;
cmd.ExecuteNonQuery();
con.Close();
cb();
MessageBox.Show("Updated", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch
{
MessageBox.Show("Error", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
는 문자열 연결을 사용하지 마십시오을. https://msdn.microsoft.com/en-us/library/ms175528(v=sql.105).aspx –
어떤 오류가 발생합니까? –
실제 오류를 게시 할 수 있습니까, 제발 우리가 도와주고 있습니다. – Wheels73