Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            string a = Convert.ToString(textBox1.Text);
            string b = Convert.ToString(textBox2.Text);

            string queryString = "SELECT * FROM [User]";
            string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Vladislav\Documents\kursach1.mdb";
            OleDbConnection myOleDbConnection = new OleDbConnection(connectionString);
            OleDbCommand myOleDbCommand = new OleDbCommand(queryString, myOleDbConnection);
            myOleDbConnection.Open();
            OleDbDataReader myOleDbDataReader = myOleDbCommand.ExecuteReader();


            while (myOleDbDataReader.Read())
            {
                if (myOleDbDataReader.GetString(0) == a && myOleDbDataReader.GetString(1) == b)
                {
                    Form4 form4 = new Form4();
                    form4.Visible = true;
                    this.Visible = false;
                    break;
                }
                
            }
            myOleDbDataReader.Close();
            myOleDbConnection.Close();
        }
Пример #2
0
        private void pictureBox1_Click(object sender, EventArgs e)
        {
            Form4 form4 = new Form4();

            form4.ShowDialog();
        }