tags:

views:

34

answers:

1

Consider the code below. I need to remove the error which is coming because of Locate. Please help me to do the same.

public virtual void updateZeroPointLast(Decimal bdID)
{
    if (!qdsErosionElSave.Open)
    {
        qdsErosionElSave.open();
    }
    // Locate the row to update
    DataRow dr = qdsErosionElSave.Tables["erosionelement"].NewRow();
    dr["EL_ID"] = bdID;
    if (qdsErosionElSave.locate(dr, Locate.FIRST))
    {
        // Update qdsErosionElSave
        DateTime tsZeroPoint = qdsErosionElSave.getTimestamp("ZEROPOINT");
        Console.WriteLine(bdID + " " + tsZeroPoint.ToString());
        qdsErosionElSave.editRow();
        qdsErosionElSave.setTimestamp("ZEROPOINTLAST", tsZeroPoint);
        qdsErosionElSave.post();
    }
}

Thanks.