コード例 #1
0
        //SignIn
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                command = "SELECT UserName, Password, LastName, CustomerId FROM Customer.dbo.Customer WHERE UserName='******' AND Password='******'";
                SelectData(command);

                if (usernamecheck.Contains(textBox1.Text) && passwordcheck.Contains(textBox2.Text))
                {
                    this.Visible = false;
                    Shop objShop = new Shop();
                    objShop.Show();
                }
                else
                {
                    throw new Exception("Please check again your 'User Name' and 'Password'!");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message.ToString());
            }
        }