Miha,
its a command line app, so no UI controls. ive tried to make the code as
brief as possible for simplicity, but obviously that may have hidden the
problem too.
more code:
DataRow[] targets = result.Select("ColA = '" + ColA + "' AND ColB = '" +
ColB + "' AND ColC = '" + ColC + "' AND ColD = '" + ColD+ "'");
if (targets.Length == 0)
{
//none exist - set up row
string secname = getSecName(secid, prices);
result.Rows.Add(new object[] {ColA, ColB, ColC, ColD, name, pos, p,
change});
}
else if (targets.Length == 1)
{
//amend exisitng
double tmpposition = (double)targets[0]["position"] + pos;
targets[0]["position"] = tmpposition;
}
else
{
throw new Exception("Too many entries found in table!!");
}
"Miha Markic [MVP C#]" <miha at rthand com> wrote in message
news:eW*************@TK2MSFTNGP10.phx.gbl...
Hi Spammy,
Is your row bound to some UI control perhaps?
Are there any other factors involved?
Normally it should be a breeze...
--
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com
"spammy" <me@privacy.net> wrote in message
news:2g************@uni-berlin.de... hi all,
my code currently reads as the following:
//////
double tmpposition = (double)dr["position"] + pos;
dr["position"] = tmpposition;
//////
where dr is a DataRow and pos is of type double. however it seems that
the second line takes quite a while to execute - around a quarter of a
second. however, adding new rows to the table in which the row resides is quick,
as is selecting etc.
am i updating the row value incorrectly?
tia!
spammy