Question: I have a DataTable called currencyAmounts and using lambda, my expression was working fine until the return had more than one possibility. I am searching the DataTable for a match to my "value" variable. How can I change the following expression to just select the first row returned:

```
DataRow resultRow = currencyAmounts.AsEnumerable().Single(r => ((decimal)r["OriginalAmount"]) == value);

```

I am getting the following error when this is run:

> 
> Sequence contains more than one matching element
> 
> 
>

Answer: 
The Error message explains it all actually. Single() throw exception when there are more than one matching element within the condition.(or there is no element). You should use `First()` or `FirstOrDefault()`

```
DataRow resultRow = currencyAmounts.AsEnumerable().FirstOrDefault(r => ((decimal)r["OriginalAmount"]) == value);

```
You can change the "Single()" with a "First()".

That's because single (from the microsoft page) "Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence."