It gives this error when trying to write to the database. System.Data.OleDb.OleDbException: "Syntax error in INSERT INTO statement."
OleDbConnection myConnection = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\комп\Documents\Visual Studio 2017\Access\myDB.accdb;Persist Security Info=False"); OleDbCommand cmd = new OleDbCommand(); cmd.Connection= myConnection; myConnection.Open(); if (myConnection.State == ConnectionState.Open) { string sql_command = ""; stpWatch.Start(); cmd.CommandType = CommandType.Text; sql_command += "INSERT INTO person ([name], [sex]) VALES('pap', 'fdd')"; cmd.CommandText = sql_command; try { Console.WriteLine(cmd.ExecuteNonQuery()); stpWatch.Stop(); Console.WriteLine(stpWatch.ElapsedMilliseconds); } catch (Exception) { throw; }
VALES->VALUES"To talk about Juvenile, Put vale at the end of the letter ..." - Igor