title: insert data from database to textbox C#
body: <p>I have 2 textboxes and 2 labels. </p>
  
  <p>label: UserID &amp; ACCType.</p>
  
  <p>textbox: Email &amp; Password.</p>
  
  <p>I want to find data from the textboxes and then insert data from the database into the 2 labels.</p>
  
  <p>so, in other words, I would like to collect the email and password in the textboxes. from this information, i want to then insert the ID and AccountType in the labels. what am I doing wrong?</p>
  
  <pre><code>        protected void Login_Click(object sender, EventArgs e)
      {
          string UID = UserID.Text;
          string AType = AccType.Text;
          string Email = Email.Text;
          string Password = Password.Text;
  
          SqlConnection con = new SqlConnection();
          con.ConnectionString = "Data Source=sql2016.fse.network;Initial Catalog=db_1518393_fse_rec; User ID=user_db_1518393_fse_rec; Password=P@55word;";
  
          Int32 verify;
          string query1 = "Select * from Accounts where Email='" + Email.Text + "' and Password='" + Password.Text + "' ";
          SqlCommand cmd1 = new SqlCommand(query1, con);
          con.Open();
          verify = Convert.ToInt32(cmd1.ExecuteScalar());
          con.Close();
          if (verify &gt; 0)
          {
              //successful
              ErrorMessage.Text += "Logging in...";
              //Response.Redirect("succesful.aspx");
  
              //display User ID &amp; Account Type
  
  
              string query2 = "INSERT * from Accounts where Email='" + Email.Text + "' and Password='" + Password.Text + "' + ID + AccountType";
              //string query2 = "Select Email, Password, ID, AccountType from Accounts(Email, Password, ID, AccountType) " + "Values('" + Email + "', '" + Password + "', '" + UID + "', '" + AType + "')";
  
          }
          else
          {
              //unsuccessful
              //Response.Redirect("unsuccesful.aspx", true);
              ErrorMessage.Text += "Email or Password incorrect! Please try again.";
          }
  
      }
  </code></pre>