viernes, 17 de octubre de 2008

Insert a Data the .net way.. (today). Just work.

Inserting Data, the .net way... .
// firebird, id_ruta pk autoinc(generator and trigger before insert), ruta_nombre varchar
// Insert ruta.
RUTASDataSet.RUTASRow ruta = _rutasDataSet.RUTAS.NewRUTASRow();
ruta.RUTA_NOMBRE = nombre;

// Add ruta to DataSource.

// Commit ruta to Database Table.

// Update Visual DataGridView
Set RUTASDataSet.xsd > ID_RUTA "Delete Primary Key" !!

( This is not the best solution, there could be inconcistances Database.ID_RUTA vs. Datagridview.ID_RUTA )

( Other solution is to use a Fill() in some place, after de commit )

No hay comentarios.: