Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SqlDataAdapter sda = new SqlDataAdapter("Select Count(*) From Login where USERNAME ='" + txtUsername.Text + "' and PASSWORD ='" + txtPassword.Text + "'",con);
- DataTable dt = new DataTable();
- sda.Fill(dt);
- if (dt.Rows[0][0].ToString() == "1")
- {
- this.Hide();
- CTMain ss = new CTMain();
- ss.Show();
- }
- else
- {
- MessageBox.Show("Please check your Username and/or Password");
- }
- private void CTMain_Load(object sender, EventArgs e)
- {
- cbxListstores.Items.Clear();
- con.Open();
- SqlCommand scm = con.CreateCommand();
- scm.CommandType = CommandType.Text;
- scm.CommandText = "select STORENAME from Login";
- scm.ExecuteNonQuery();
- DataTable dt = new DataTable();
- SqlDataAdapter sda = new SqlDataAdapter(scm);
- sda.Fill(dt);
- foreach (DataRow dr in dt.Rows)
- {
- cbxListstores.Items.Add(dr["STORENAME"].ToString());
- cbxListstores.SelectedIndex = 0;
- }
- con.Close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement