G
Guest
The following code never finds a matching row even when one exists. It
appears that the method thinks there is only one value being passed to the
method even though the object array that is passed has 2 elements, and both
elements have values.
Any ideas?
if ((dsReturned.Tables.Count > 0) && (dsReturned.Tables[0].Rows.Count > 0))
{
object[] objKeys = new object[2];
DataRow drFound;
foreach (DataRow dr in dsReturned.Tables[0].Rows)
{
objKeys[0] = dr["ItemID"]; // String
objKeys[1] = dr["ItemTrackDateTime"]; // DateTime
drFound = dsItemTracks.Tables[0].Rows.Find(objKeys);
if (drFound != null)
{
drFound.Delete();
}
}
}
appears that the method thinks there is only one value being passed to the
method even though the object array that is passed has 2 elements, and both
elements have values.
Any ideas?
if ((dsReturned.Tables.Count > 0) && (dsReturned.Tables[0].Rows.Count > 0))
{
object[] objKeys = new object[2];
DataRow drFound;
foreach (DataRow dr in dsReturned.Tables[0].Rows)
{
objKeys[0] = dr["ItemID"]; // String
objKeys[1] = dr["ItemTrackDateTime"]; // DateTime
drFound = dsItemTracks.Tables[0].Rows.Find(objKeys);
if (drFound != null)
{
drFound.Delete();
}
}
}