problem insert into access DB
Hi
I'm trying to insert into access DB this data using this code
is any one can explain what is wrong with this code ????
the code :
---------------------------------------------------------------------------------------
OleDbConnection connection = new OleDbConnection(strDBConn);
OleDbTransaction transaction;
String sql = "INSERT INTO TblProjects (field1, field2, field3, field4, field5)" +
" VALUES ('" + txtbx_ProjectName.Text +
"','" + ddlst_SystemsType.SelectedItem.Text +
"','" + ddlst_Versions.SelectedItem.Text +
"','" + ddlst_Tester.SelectedItem.Text +
"','" + ddlst_ProjectManager.SelectedItem.Text + "');";
connection.Open();
transaction = connection.BeginTransaction();
st = sql;
OleDbCommand commmand = new OleDbCommand(sql, connection);
commmand.CommandType = CommandType.Text;
commmand.Transaction = transaction;
commmand.ExecuteNonQuery();
transaction.Commit();
connection.Close();
Response.Redirect("aspPage.aspx");
---------------------------------------------------------------------------------------
the exception is :
Operation must use an updateable query.
---------------------------------------------------------------------------------------
the SQL is:
INSERT INTO TblProjects (field1, field2, field3, field4, field5)
VALUES ('aaa','bbb','ccc','ddd','eee');
crend_kingPosted Feb 11, 2004, 8:28 AM
crend_kingPosted Feb 9, 2004, 10:29 AM
crend_kingPosted Feb 9, 2004, 9:52 AM
crend_kingPosted Feb 9, 2004, 9:46 AM
suhil.srinivasPosted Jan 22, 2004, 12:13 PM
georgeskaddoumPosted Jan 21, 2004, 9:43 AM
Tanvir HudaPosted Jan 5, 2004, 12:16 AM
AdministratorPosted Mar 18, 2003, 6:05 AM
AdministratorPosted Mar 9, 2003, 5:05 PM
AdministratorPosted Mar 8, 2003, 12:03 AM