views:

156

answers:

2

What am I doing wrong. I get an error that says sequence has no arguements.

PumpSUM.tblcards card = ps.tblcards.First(p => (p.PinId == 1223 && p.CardId == 321));
+3  A: 

It seems that this problem occurs when there is no first element to choose.You'd better use FirstOrDefault function.

Beatles1692
That was it! Thank you so much for your time.
Yes I agree with Gred, I would just add when you use FirstOrDefault if your query yields nothing, then FirstOrDefault will return null.
mosessaur
A: 

Use Take(1) or FirstOrDefault instead.

JG