I have a problem when running my code, an error occurs
Input string was not in a correct format.
My code is:
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='"+Convert.ToInt32(lblID.Text)+"'";
// cmd.Parameters.AddWithValue("@CompanyId", Convert.ToInt32(lblID.Text));
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 this happens. Can anyone suggest to me why this might be?