Counting row from a specific DataRow
<p>I have a selected <code>DataRow</code> (dr1) from ComboBox, and I want to count row from selected <code>DataRow</code>.</p>

<pre><code>private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        string searchfor =  comboBox1.Text;
        int results = 0;
        DataRow[] returnedrows;

       returnedrows  = ds1.Tables["workers"].Select("first_name='" + searchfor + "'");

        results = returnedrows.Length;

        if (results &gt; 0)
        {
            DataRow dr1;
            dr1 = returnedrows[0];

            textBox1.Text = dr1[1].ToString(); textBox2.Text = dr1[2].ToString();
            textBox3.Text = dr1[3].ToString(); textBox4.Text = dr1[4].ToString();
            textBox5.Text= dr1[5].ToString();

        }
        else
        {
            MessageBox.Show("no such records");
        }
</code></pre>
