Skip to content

Exception

msizi dlamini

Asked Feb 26, 2015, 4:02 AM EST2 answers
Share
LinkedInX
Good Day
May anyone assist me, i am still a junior is applications development and i am developing an application. have reached my login button to send me to another form. please assist me any body my code below, when i run it it throws this exception 
 
An unhandled exception of type 'System.NotImplementedException' occurred in Balanced ScoreCard.exe
Additional information: The method or operation is not implemented.
 
Java
           try
            {
                if (!(usertxt.Text == string.Empty))
                {
                    if (!(userpa.Text == string.Empty))
                    {
                        String str = "server=MSIZI-PC03;database=windowapp;UID=sa;password=123";
                        String query = "select * from data where username = '" + usertxt.Text + "'and password = '" + this.userpa.Text + "'";
                        SqlConnection con = new SqlConnection(str);
                        SqlCommand cmd = new SqlCommand(query, con);
                        SqlDataReader dbr;
                        con.Open();
                        dbr = cmd.ExecuteReader();
                        int count = 0;
                        while (dbr.Read())
                        {
                            count = count + 1;
                        }
                        if (count == 1)
                        {
                            MessageBox.Show("username and password is correct");
                        }
                        else if (count > 1)
                        {
                            MessageBox.Show("Duplicate username and password", "Login Form");
                        }
                        else
                        {
                            MessageBox.Show(" username and password incorrect", "Login Form");
                        }
                    }
                    else
                    {
                        MessageBox.Show(" password empty", "Login Form");
                    }
                }

                else
                {
                    MessageBox.Show(" username empty", "Login Form");
                }
                // con.Close();

            }
            catch (Exception)
            {
                FrmMain.show();

            }
 

2 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Vithal Wadje
    0
    check ,whether you have used interface and not implemented
    0
  • 0
    Thank you i have checked my code, yes the interface is declared and used i do not know why it handles this exception
    0