Got error "Syntax error in INSERT INTO statement".

Jan 8 2018 6:12 AM
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText ="insert into clientloan (ClientId,name,addr,phone,email,amount,start_date,end_date,installment,month,perins) values (@ClientId,@name,@addr,@phone,@email,@amount,@start_date,@end_date,@installment,@month,@perins )";
cmd.Connection = con;
cmd.Parameters.Add("@ClientId", OleDbType.VarChar).Value = textBox7.Text.Trim() ;
cmd.Parameters.Add("@name",OleDbType.VarChar).Value = textBox2.Text.Trim();
cmd.Parameters.Add("@addr",OleDbType.VarChar).Value = textBox3.Text.Trim();
cmd.Parameters.Add("@phone",OleDbType.VarChar).Value = textBox4.Text.Trim();
cmd.Parameters.Add("@email", OleDbType.VarChar).Value =textBox5.Text.Trim();
cmd.Parameters.Add("@amount",OleDbType.VarChar).Value = textBox1.Text.Trim();
cmd.Parameters.Add("@start_date",OleDbType.VarChar).Value = dateTimePicker1.Text.Trim();
cmd.Parameters.Add("@end_date", OleDbType.VarChar).Value =dateTimePicker2.Text.Trim();
cmd.Parameters.Add("@installment",OleDbType.VarChar).Value = textBox9.Text.Trim();
cmd.Parameters.Add("@month",OleDbType.VarChar).Value = textBox6.Text.Trim();
cmd.Parameters.Add("@perins",OleDbType.VarChar).Value = textBox8.Text.Trim();
cmd.ExecuteNonQuery(); //Error occured here.
con.Close();
MessageBox.Show("Loan details Inserted Succesfully here");

Answers (2)