Hallo!
Ich habe folgenden Code:
private string connectionString;
private OleDbConnection oleDbConnection;
private OleDbCommand oleDbCommand;
private OleDbDataReader oleDbReader;
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=figuren.mdb";
oleDbConnection = new OleDbConnection(connectionString);
string category = categories.txtCategorie.Text;
string year = categories.txtYear.Text;
string desc_long = categories.txtDesc_long.Text;
string picture = categories.txtPicture.Text;
string sql = "UPDATE ueei_categories SET category = '"+category+"', year = '"+year+"', desc_long = '"
+ ""+desc_long+"', image = '"+picture+"' WHERE id = " + productID;
oleDbCommand = new OleDbCommand(sql);
oleDbCommand.Connection = oleDbConnection;
oleDbConnection.Open();
oleDbCommand.ExecuteNonQuery();
oleDbConnection.Close();
Allerdings bekomme ich bei ExecuteNonQuery() immer folgende Fehlermeldung:
Eine nicht behandelte Ausnahme des Typs 'System.Data.OleDB.OleDbException' ist in system.data.dll aufgetreten.
Kann mir dabei jemand behilflich sein, wie das Problem lösen kann?
MfG
Jens
Ich habe folgenden Code:
private string connectionString;
private OleDbConnection oleDbConnection;
private OleDbCommand oleDbCommand;
private OleDbDataReader oleDbReader;
connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=figuren.mdb";
oleDbConnection = new OleDbConnection(connectionString);
string category = categories.txtCategorie.Text;
string year = categories.txtYear.Text;
string desc_long = categories.txtDesc_long.Text;
string picture = categories.txtPicture.Text;
string sql = "UPDATE ueei_categories SET category = '"+category+"', year = '"+year+"', desc_long = '"
+ ""+desc_long+"', image = '"+picture+"' WHERE id = " + productID;
oleDbCommand = new OleDbCommand(sql);
oleDbCommand.Connection = oleDbConnection;
oleDbConnection.Open();
oleDbCommand.ExecuteNonQuery();
oleDbConnection.Close();
Allerdings bekomme ich bei ExecuteNonQuery() immer folgende Fehlermeldung:
Eine nicht behandelte Ausnahme des Typs 'System.Data.OleDB.OleDbException' ist in system.data.dll aufgetreten.
Kann mir dabei jemand behilflich sein, wie das Problem lösen kann?
MfG
Jens