Getting index of a value in DataTable
<p>i need to get index of a value in DataTable.</p>

<p>I'm trying to get like that.</p>

<pre><code> SqlDataAdapter da = new SqlDataAdapter("SELECT MessageID,SenderID,MessageContent FROM Messages WHERE ThreadID="+ThreadID, connectionString);
 //Get all messages in the Thread.
 DataTable dt = new DataTable();
 da.Fill(dt);

 da.SelectCommand.CommandText = "SELECT MessageID,SenderID,MessageContent FROM Messages WHERE MessageID="+MessageID;
 //Get the message which i need to get index.
 DataTable dtMsg = new DataTable();
 da.Fill(dtMsg);
 //Get index of dtMsg.Rows[0] in dt.
 int msgIndex = dt.Rows.IndexOf(dtMsg.Rows[0]);
</code></pre>

<p>I analized it when debugging values are same but its returning -1 everytime.
What i can do?</p>
