I am trying to retrieve a string value from SQL server database, i am working on C# project and i am using LINQ to SQL. this is my code snippet
using (AlHayatEntities entity = new AlHayatEntities())
{
var query = from o in entity.users
where o.userName == "" + txtUsername.Text && o.password == "" + txtPassword.Text
select o.role;
MessageBox.Show(query + "");
}
and this is what the table is
id | userName | password | role
1 shareef 123 admin
I want the message to print "admin" out, but it does not.