Example #1
0
    // Hier wird die Tabelle TypPunkte mit den nötigen Werten gefüllt.
    // Es wurde nur am anfang benötigt um Änderungen bei jedem Start zu übernehmen
    // Wird zurzeit nicht mehr genutzt
    public void fillTypPunkt()
    {
        Debug.Log ("fillTypPunkte");
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection.Open();
        sql = " Delete From TYPPUNKTE";
        _command.CommandText = sql;
        _command.ExecuteNonQuery ();

        _command.Dispose ();
        _command = null;
        _connection.Close ();
        _connection.Dispose ();
        _connection = null;

        TypPunkte typen = new TypPunkte ();
        typen.setID ("1"); typen.setTypbezeichnung ("Abzweigung"); this.addTypforPunkt (typen);
        typen.setID ("2"); typen.setTypbezeichnung ("ParkPlatzFront"); this.addTypforPunkt (typen);
        typen.setID ("3"); typen.setTypbezeichnung ("Parkplatz"); this.addTypforPunkt (typen);
        typen.setID ("4"); typen.setTypbezeichnung ("Start"); this.addTypforPunkt (typen);
    }
Example #2
0
    // Hier werden die Datensätze in die Datenbank Eingefügt für die Tabelle TypPunkte.
    // Die einzufügenden Werte werden als Parameter gegeben.
    void addTypforPunkt(TypPunkte typen)
    {
        IDbConnection _connection = new SqliteConnection(_strDBName);
        IDbCommand _command = _connection .CreateCommand();
        string sql;
        _connection .Open();
        sql = "INSERT INTO TYPPUNKTE (ID, TYPBEZEICHNUNG) Values ("+typen.getID()+",'"+typen.getTypBezeichnung()+"')";
        _command.CommandText = sql;
        _command.ExecuteReader();

        _command.Dispose ();
        _command = null;
        _connection.Close ();
        _connection.Dispose ();
        _connection = null;
    }