title: Check username exists in database or not
body: <p>doing this username checking in c#,it always enter if same name given,It never shows checking,plz tell why?    </p>
  
  <pre><code>SqlConnection con = new SqlConnection("Data Source=.\\SQLEXPRESS;Initial Catalog=Ro;Integrated Security=True");
          con.Open();
          SqlCommand cmd = new SqlCommand("select Name from [Machine]", con);
          SqlDataReader rdr = cmd.ExecuteReader();
          while(rdr.Read())
          {
              query=rdr.GetString(0);
              if (query == textBox1.Text)
              {
                  System.Windows.Forms.MessageBox.Show("MachineName Already exists!!!");
              }
              else
              {
                  this.db.Datastore("INSERT INTO [Roamani].[dbo].[Machine] ([Name],[Type],[AETitle],[IPAddress],[Port]) VALUES('" + textBox1.Text + "','" + comboBox1.SelectionBoxItem + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "')");
                  this.Hide();
                  m.Show();
                  return;
              }
              //return;
          }          
  </code></pre>