Compare date with Ingres.Client and C#
Hello. I work with Ingres.Client 2.1.0.0 in C#.
My code:
IngresConnection IngCnn = new IngresConnection("UID = recauda; PWD = xxxx; Role ID = sprtri; Role Password = xxxx;Host=172.26.31.122;Database=labprod;date_form at=DMY;Connect Timeout=60");
IngresCommand Cmd = IngCnn .CreateCommand();
IngCnn.Open();
CadSQLIngres = "select contrib_origen, contrib_destino, usuario, fecha_orden" +
" from conver_contrib";
DataSet ConverContrib = new DataSet();
IngresDataAdapter DAConCon = new IngresDataAdapter(CadSQLIngres,IngCnn);
DAConCon.Fill(ConverContrib);
TotalAConvertir = ConverContrib.Tables[0].Rows.Count;
foreach (DataRow FilaConCon in ConverContrib.Tables[0].Rows)
{
..........
..........
..........
CadSQLIngres = " update conver_contrib set fecha_conv = 'now'" +
" where contrib_origen = " + FilaConCon["contrib_origen"] +
" and contrib_destino = " + FilaConCon["contrib_destino"] +
" and fecha_orden = '" + FilaConCon["fecha_orden"].ToString() + "'";
NTuplas = Cmd.ExecuteNonQuery();
}
The result of NTuplas is 0 because fecha_orden = '" + FilaConCon["fecha_orden"].ToString() + "'" dates do not match.
If connect by ODBC (OdbcConnection) to Ingres, the update work fine.
thank you very much.
En español.
Con el Ingres.Client, a la hora de hacer el update, el resultado es cero, porque las fechas no coinciden, siendo estas las mismas (mismo campo y misma tabla).
Por ODCB la sentencia se ejecuta sin nigún problema.
Muchas gracias.
|