the IndexOf() method returns -1 all the time
<p>i have two data tables with the same structure</p>

<p>the first one has one row of the second one</p>

<p>the second one has set of rows </p>

<p>what i want is to get the row which comes next to the row of the first data table in the second data table.</p>

<p>the first data table his name is :: temp</p>

<p>the second data table his name is :: dt</p>

<p>i do the following:</p>

<pre><code>DataTable temp = new DataTable();
temp = dt.Clone();
DataColumn[] keyColumn = new DataColumn[1];
keyColumn[0] = temp.Columns["photoId"];
temp.PrimaryKey = keyColumn;
temp = (DataTable)(Session["currentImage"]);
DataRow[] drr = new DataRow[1];

index = dt.Rows.IndexOf(temp.Rows[0]);
</code></pre>

<p>but the index always comes with one value = -1 </p>

<p>although the temp.rows[0] its contents changed all the time</p>

<p>when i write dt.Rows.IndexOf(dt.Rows[1]) for examble i get 1</p>

<p>but this is not what i want to do ,, what i want to do exactly is to get the datarow next to the datarow of the first dataTable in the second dataTable</p>

<p>please help me.</p>
