Ejemplo n.º 1
0
 private void DoInsertCommand(SQLiteConnection sqlcon, SQLInsertTable table)
 {
     CommandPerformed = $"{table.GetSqlWithParameters()}{Environment.NewLine}{table.GetParamList().ToString()}";
     SQLPerformed     = table.GetSql();
     try
     {
         SqliteConnection db = sqlcon.GetConnection();
         using (SqliteCommand command = db.CreateCommand())
         {
             command.CommandText = table.GetSqlWithParameters();
             List <SqliteParameter> Params = GetCommandParameters(table.GetParamList());
             if (Params.Count > 0)
             {
                 foreach (var p in Params)
                 {
                     command.Parameters.Add(p);
                 }
             }
             command.ExecuteNonQuery();
         }
         Success = true;
     }
     catch
     {
         Success = false;
     }
 }