Since you seem to be using Entity Framework, that code would be something like this:
using (YourDatabaseContext context = new YourDatabaseContext())
{
User firstUser = context.Users.FirstOrDefault(u => u.statusUser == 0);
if (firstUser != null)
{
lblUserName.Text = firstUser.nameUser;
}
}
You should definitely check out some of the introductory tutorials on Entity Framework:
- An Introduction to Entity Framework for absolute beginners
- ADO.NET Entity Framework Tutorial and Basics
or just search on Google or Bing for Entity Framework introductory tutorial
- there are thousands of those out there!