-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathForm9.cs
66 lines (59 loc) · 1.8 KB
/
Form9.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace Liberary_management_system
{
public partial class Form9 : Form
{
public Form9()
{
InitializeComponent();
}
private void Form9_Load(object sender, EventArgs e)
{
con = new SqlConnection("Data Source=TAYYAB\\SQLEXPRESS;Initial Catalog=Lab;User ID=sa;Password=1234");
con.Open();
}
SqlConnection con;
private void button1_Click(object sender, EventArgs e)
{
string p = textBox1.Text;
string u = textBox2.Text;
string pass = textBox3.Text;
string pass1 = textBox4.Text;
if (p=="" || u=="" || pass=="" || pass1=="")
{
label6.Text = "All fields are required";
}
else
{
if (pass == pass1)
{
SqlCommand cnd = new SqlCommand("UPDATE loglms SET password='"+pass+"' WHERE username='" + u + "' and password='" + p + "'", con);
cnd.ExecuteNonQuery();
}
else
{
label7.Text = "re type password not match";
}
}
}
private void button2_Click(object sender, EventArgs e)
{
this.Hide();
Form4 f4 = new Form4();
f4.Show();
}
private void button3_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}