Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace WpfApplication1
- {
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, RoutedEventArgs e)
- {
- SqlConnection con = new SqlConnection("Data Source=(local);Initial Catalog=Aukcija;Integrated Security=True");
- con.Open();
- SqlDataAdapter sda = new SqlDataAdapter("SELECT Role FROM users WHERE Username='"+ textBoxUser.Text +"' and Password='"+ passBoxPwd.Password + "' ", con);
- DataTable dt = new DataTable();
- sda.Fill(dt);
- if (dt.Rows.Count == 1)
- {
- this.Hide();
- Window1 w1 = new Window1();
- w1.Show();
- }
- con.Close();
- }
- private void button2_Click(object sender, RoutedEventArgs e)
- {
- this.Close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement