title: Why does the LINQ query return no element?
body: <p>I have the following code, and database, and I don't understand the problem. Whenever I try to run the program, it always throws this exception:
  <em>An unhandled exception of type 'System.InvalidOperationException' occurred in System.Core.dll</em></p>
  
  <p>In my User database there is a row with UserName: majorcsanad and Password: 722308, and when I try to log in with thus name/password, it sais it contains zero element.</p>
  
  <p>My code is the following:</p>
  
  <pre><code>public partial class Login : Form
  {
      szofttech2Entities context = new szofttech2Entities();
      public Login()
      {
          InitializeComponent();
      }
      private void buttonEnter_Click(object sender, EventArgs e)
      {
  
          var password = (from u in context.Users
                         where u.UserName == textBoxUserName.Text
                         select u.Password).Single();
  
          if (textBoxPassword.Text == password)
          {
              Order order = new Order();
              order.Show();
              this.Hide();
          }
          else
          {
              labelWrongUserPassword.Visible = true;
          }    
      }
  }
  </code></pre>