我尝试了一切,但总是在“com.Transaction = trx;”处返回 System.NullreferencesException
public override int ExecuteNonQuery(string query)
{
int register=0;
SQLiteTransaction trx=null;
SQLiteCommand com;
try
{
if (this.IsClosed()) this.Open();
trx = con.BeginTransaction();
com = new SQLiteCommand(query, con);
com.Transaction = trx;
register = com.ExecuteNonQuery();
trx.Commit();
return register;
}
catch (SQLiteException ex)
{
trx.Rollback();//se tiene q deshaser toda la trransaccion hecha
throw ex;
}
finally
{
this.Close();
}
}
我不知道我的错误在哪里:(
这是让我陷入交易的异常
更新:
这是异常细节