Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!string.IsNullOrEmpty(txtUser.Text))
- {
- string constring = ConfigurationManager.ConnectionStrings["ConnData"].ConnectionString;
- SqlConnection con = new SqlConnection(constring);
- SqlCommand cmd = con.CreateCommand();
- cmd.CommandType = CommandType.Text;
- cmd.CommandText = "select Username from UserLogin where Username ='" + txtUser.Text + "'";
- DataTable dt = new DataTable();
- SqlDataAdapter da = new SqlDataAdapter(cmd);
- da.Fill(dt);
- if (dt.Rows.Count > 0)
- {
- txtUser.Clear();
- PasswordChange pc = new PasswordChange();
- pc.Show();
- this.Hide();
- return;
- }
- else
- {
- MessageBox.Show("Your username incorrect");
- }
- }
- else
- {
- MessageBox.Show("Please enter your username");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement