| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 
 |  
public void setDocType(DataTable newData)
        {
            this.adapter.MissingSchemaAction = MissingSchemaAction.AddWithKey;
            this.adapter.InsertCommand = new OleDbCommand("INSERT INTO type_document(type_document_designation, type_document_nom, type_document_donnee) VALUES (?, ?, ?)", this.conn);
            this.adapter.UpdateCommand = new OleDbCommand("UPDATE type_document SET type_document_designation = ?, type_document_nom = ?, type_document_donnee = ? WHERE type_document_designation = ?", this.conn);
            this.adapter.DeleteCommand = new OleDbCommand("DELETE FROM type_document WHERE type_document_designation = ?", this.conn);
            this.adapter.InsertCommand.Parameters.Add("@type_document_designation", OleDbType.VarChar, 5, "Désignation");
            this.adapter.InsertCommand.Parameters.Add("@type_document_nom", OleDbType.VarChar, 20, "Nom type");
            this.adapter.InsertCommand.Parameters.Add("@type_document_donnee", OleDbType.VarChar, 20, "Donnée type");
            this.adapter.UpdateCommand.Parameters.Add("@type_document_designation", OleDbType.VarChar, 5, "Désignation");
            this.adapter.UpdateCommand.Parameters.Add("@type_document_nom", OleDbType.VarChar, 20, "Nom type");
            this.adapter.UpdateCommand.Parameters.Add("@type_document_donnee", OleDbType.VarChar, 20, "Donnée type");
            //this.adapter.UpdateCommand.Parameters.Add("@oldtype_document_designation", OleDbType.VarChar, 5, "Désignation").SourceVersion = DataRowVersion.Original;
            this.adapter.DeleteCommand.Parameters.Add("@type_document_designation", OleDbType.VarChar, 5, "Désignation").SourceVersion = DataRowVersion.Original;
            this.adapter.Update(newData);
        } | 
Partager