Trying to do INSERT INTO into ACCESS database on Windows Form (C#), it doesn't give me any errors.
Connection Code:
public Connection()
{
string path = AppDomain.CurrentDomain.BaseDirectory;
AppDomain.CurrentDomain.SetData("DataDirectory", path);
string connString = "provider='Microsoft.jet.OleDb.4.0'; data source='|DataDirectory|\\App_Data\\maple_data.mdb'";
this.con = new OleDbConnection(connString);
}
The INSERT INTO code:
Connection c = new Connection();
c.conOpen();
OleDbCommand cm = new OleDbCommand();
cm.Connection = c.Con;
cm.CommandText = "INSERT INTO bot ([keystroke], [timer], [position]) VALUES (@key, @spamTime, 1)";
cm.Parameters.AddWithValue("@key", Key.Text);
cm.Parameters.AddWithValue("@spamTime", spamTime);
cm.ExecuteNonQuery();
c.conClose();
MessageBox.Show("Key as been added.");
Thank you.