mi spiegate dov'è l'errore di questa query?
INSERT INTO Users(UserName, Password, Email, HomePage, ICQ, AIM, Yahoo, BirthDate, Biography, Location, Interests, Occupation) VALUES ('sdf', 'sdf', 'sdf@sdf.sdf', null, null, null, null, null, null, null, null, null)
facendolo partire da db (con ms access) mi funziona mentre da asp.net no!
il codice che uso è questo:
l'errore avviene nella riga in rossocodice:OleDbConnection objConnection = new OleDbConnection(ConnString); objConnection.Open(); // Start a local transaction. OleDbTransaction objTrans = objConnection.BeginTransaction(); // Enlist the command in the current transaction. OleDbCommand objCommand = new OleDbCommand(); objCommand.Transaction = objTrans; objCommand.Connection = objConnection; try { for (int a=0; a < sql.Length; a++) { objCommand.CommandText = sql[a]; objCommand.ExecuteNonQuery(); } objTrans.Commit(); } catch(Exception e) { objTrans.Rollback(); throw e; } finally { objConnection.Close(); }
sql[0] contiene la query di qui sopra