Think the best of others
Friday, October 17, 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.
_rutasDataSet.RUTAS.AddRUTASRow(ruta);
// Commit ruta to Database Table.
_rutasTableAdapter.Update(ruta);
// Update Visual DataGridView
Set RUTASDataSet.xsd > ID_RUTA "Delete Primary Key" !!
Set RUTASDataSet.xsd > ID_RUTA "AUTOINCREMENT" !!
( 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 )
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment