Take a look at your Linq query:
var q = from m in pos.Credentials where c.UserName == usernamelabel.Text select m;
What
c
is doing there?
I guess that
q
returns a
IEnumerable<Credential>
. So, you have to loop through the collection of Credential to be able to use its properties:
foreach(Credential c in q)
{
Console.WriteLine("{0}", c.FirstName);
}
But... if you would like to return single object, try this:
var q = pos.Credentials.Where(c=>c.UserName == "User1").SingleOrDefault();
then:
fnamelabel.Text = q.FirstName