So I'm receiving this problem, I tried everything. Kinda stuck
My access database design:
ID - AutoNumber
Data - ShortText
And the insert command:
OleDbCommand command = new OleDbCommand();
string sql = "INSERT INTO Table (Data) VALUES (@Data)";
OleDbCommand cmd = new OleDbCommand(sql, connection);
cmd.Parameters.AddWithValue("@Data", "Test");
connection.Open();
try
{
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show("err: " + ex);
throw;
}
connection.Close();
This might be dumb but I'm really lost and I have no idea what to do.