Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROC LoginUser
- @username nvarchar(50),
- @password nvarchar(50)
- AS
- BEGIN
- IF EXISTS(SELECT * FROM [JDKdb].[dbo].[Accounts] WHERE Username=@username AND Password=@password)
- BEGIN
- RETURN 1
- END
- ELSE
- BEGIN
- RETURN 0
- END
- END
- private void btnLogin_Click(object sender, EventArgs e)
- {
- string access = "";
- access = db.LoginUser(txtUsername.Text, txtPassword.Text).ToString();
- if (access == "1")
- {
- this.Hide();
- FrmDashboard dash = new FrmDashboard(txtUsername.Text);
- dash.ShowDialog();
- }
- else
- {
- MessageBox.Show("Invalid account" + access);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement