I
Ibai Peña
Hi,
I´m trying to find a row in a dataview. First I define a PrimaryKey to the
DataTable and then try to find a value, but gives me this error:
An unhandled exception of type 'System.ArgumentException' occurred in
System.Data.dll
Additional information: Expecting 0 value(s) for the key being indexed, but
received 1 value(s).
Here is some the code that I use:
DataColumn[] keys = new DataColumn[1];
keys[0] = TInventario.Columns["codigoart"];
TInventario.PrimaryKey = keys;
VInventario = TInventario.DefaultView;
string temp = (string)TempRow[0];
int Seleccionado = VInventario.Find((object)temp);
I have tried VInventario.Find(temp); too without succed
What am I doing wrong?
thanks in advance,
I´m trying to find a row in a dataview. First I define a PrimaryKey to the
DataTable and then try to find a value, but gives me this error:
An unhandled exception of type 'System.ArgumentException' occurred in
System.Data.dll
Additional information: Expecting 0 value(s) for the key being indexed, but
received 1 value(s).
Here is some the code that I use:
DataColumn[] keys = new DataColumn[1];
keys[0] = TInventario.Columns["codigoart"];
TInventario.PrimaryKey = keys;
VInventario = TInventario.DefaultView;
string temp = (string)TempRow[0];
int Seleccionado = VInventario.Find((object)temp);
I have tried VInventario.Find(temp); too without succed
What am I doing wrong?
thanks in advance,