Use the First() or FirstOrDefault() command to retrieve single row records in LINQ.

Example

                                        

var users = (from u in dc.Users where u.UserName == usn select u).FirstOrDefault();

Suggest An Answer

No suggestions Available!