Error calling Locate() on DataSet
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();
d开发者_运维知识库r["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.
Is Locate.First null? I'd check that.
精彩评论