I have a problem when i m run my code then updating is successful but I want to update only one row . when through my code all data is update .
My code is:
Code
protected void imgbtn_Save_Click(object sender, EventArgs e)
{
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText = "update Companies set CompanyFName='" + txt_ComName.Text + "',CompanySName='" + txt_ShortName.Text + "',CompanyeMail='" + txt_email.Text + "',CompanyWebsite='" + txt_website.Text + "'where CompanyId=CompanyId";
cmd.Connection = conn;
OleDbDataAdapter da = new OleDbDataAdapter();
da.UpdateCommand = cmd;
cmd.ExecuteNonQuery();
conn.Close();
BindGridData();
lblError.Font.Bold = true;
lblError.Font.Size = 11;
lblError.Text = "You have successfully modified the case!";
}
I don't know why?
Plz suggest me.
"Thanks"