private void button3_Click(object sender, EventArgs e) { optionpage c = new optionpage(); c.Show(); Hide(); }
private void submit_Click(object sender, EventArgs e) { con.ConnectionString = "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=mca1285; Password=User123; Data Source=nitt"; try { con.Open(); if (Convert.ToBoolean(con.State)) { MessageBox.Show("Connection Success"); } } catch { MessageBox.Show("Connection Failed"); } com.Connection = con; com.CommandText = "select pword from profile where uname='" + uname.Text + "' "; string pwd = Convert.ToString(com.ExecuteScalar()); bool result = pwd.Equals(pword.Text, StringComparison.Ordinal); if (result) { optionpage c = new optionpage(); c.Show(); Hide(); } else { uname.Text = ""; pword.Text = ""; MessageBox.Show("Invalid Credentials"); } }