I know that it was 1,000,000,000 times, but not a single solution helped me.
I want to insert data in C # using OleDB. I tried millions of solutions, but here is the simplest one that should work, but it is not:
SQLCONNECTION = @"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=|DataDirectory|\dbScenariusz.mdb";
using (OleDbConnection connection = new OleDbConnection(SQLCONNECTION))
{
string sql = "INSERT INTO Table (content) VALUES('lala')";
connection.Open();
OleDbCommand command = new OleDbCommand(sql, connection);
command.ExecuteNonQuery();
connection.Close();
}
SQLCONNECTION is fine. It works fine for a SELECT query.
string sql - I tried this query in Access and it works fine.
I get no errors . He simply did not insert anything into the database. When I run a query in Access (in the same database), a row is inserted.
It is strange that command.ExecuteNonQuery (); returns 1! This means that 1 line is affected!
I really don't know where the problem is, so I really appreciate any help. Sorry for my English.
: . , ! wtf?:)