msizi dlamini

msizi dlamini

  • NA
  • 3
  • 1.1k

Exception

Feb 26 2015 9:02 AM
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.
 
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();
}
 

Answers (2)