<p>I am working on a windows form application. How do i use the find method of a datatable to find a row if the datatable has a compound key?</p>

<p>Table Structure
Col A, Col B, Col C</p>

<p>Col A and Col B make up the compound key.
I want to find the row where the value in Col A is 6 and Col B is 5</p>

When you "set" the Primary key of the datatable, the parameter value is an array of DataColumns...
if your datatable is in variable dt...,
```
```
dt.PrimaryKey = new DataColumn[] {dt.Columns["ColA"], dt.Columns["ColB"]};
```
```
Then pass an array of object values to the Find() method
```
```
object[] keyVals = new object[] {6, 5};
DataRow dr = dt.Rows.Find(keyVals);
```
```
or, just
```
```
DataRow dr = dt.Rows.Find(new object[] {6, 5});
```
```