Access table based on selection criteria in C#
<p>I am working on application where I got to access data from 2 sheets, get the account number from first sheet and then look for those accounts in sheet 2.<br>
I am using <code>OleDbDataAdapter</code> to select and count the number of occurrance but now the issue is to access those records out of all. 
One way I am thinking is to get the first occurrance row number, number of rows with specific account and use for loop to access each row.    </p>

<p>Is there any other method you think of doing this.... Thanks,</p>

<pre><code>oconn2.Open();
OleDbDataAdapter db = new OleDbDataAdapter("select * from [Sheet2$] where [Sheet2$].account_number= '" + account_number + "'", oconn2);
DataTable dt = new DataTable();
db.Fill(dt);
int iRow = dt.Rows.Count;
</code></pre>
