Detectar si no se ha cambiado ningun registro (No existe NIS?)
This commit is contained in:
parent
3ce6d5c8ea
commit
177b16b5c4
|
@ -103,7 +103,10 @@ namespace LectorVerdnatura
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
db.ejecutarsql(SqlInsert);
|
int RowsAffected = db.ejecutarsql(SqlInsert);
|
||||||
|
if (RowsAffected == 0) { // = 0 pero sin error de ya existe puede ser que no existe el NIS
|
||||||
|
throw new Exception("Error: Ejecucion SQL no ha insertado datos. ¿No existe NIS: " + sdwEnrollNumber + " ?");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (OdbcException ex) when (ex.Errors[0].NativeError == 1062)
|
catch (OdbcException ex) when (ex.Errors[0].NativeError == 1062)
|
||||||
{
|
{
|
||||||
|
|
Reference in New Issue