N
ng kiat
i have been doing this for awhile and i can't get it through.i am doind
a password login using database get password from ms access then i am
able to log in. but when i run this my catch did not run when it finish
with try it will end by itself. this is my code.
protected void btnLogin_Click( object sender, EventArgs e)
{
OleDbConnection conn5;
try
{
string strConn5 =
(string)System.Configuration.ConfigurationManager.AppSettings["Connectio
nString"];
string strLogin = "SELECT * FROM Pass WHERE Login = ('" +
txtLogin.Text + "') AND Password = ('" + txtPassword.Text + "')";
conn5 = new OleDbConnection(strConn5);
OleDbCommand cmd5 = new OleDbCommand(strLogin, conn5);
OleDbDataReader reader;
conn5.Open();
reader = cmd5.ExecuteReader();
while (reader.Read())
{
AdminMultiview.SetActiveView(AdminMainPage);
}
reader.Close();
conn5.Close();
}
catch (Exception ex)
{
lblWrong.Text = "Please check your Login ID and Password again.
";
lblWrong.Text += ex.Message;
}
}
anybody can help me
a password login using database get password from ms access then i am
able to log in. but when i run this my catch did not run when it finish
with try it will end by itself. this is my code.
protected void btnLogin_Click( object sender, EventArgs e)
{
OleDbConnection conn5;
try
{
string strConn5 =
(string)System.Configuration.ConfigurationManager.AppSettings["Connectio
nString"];
string strLogin = "SELECT * FROM Pass WHERE Login = ('" +
txtLogin.Text + "') AND Password = ('" + txtPassword.Text + "')";
conn5 = new OleDbConnection(strConn5);
OleDbCommand cmd5 = new OleDbCommand(strLogin, conn5);
OleDbDataReader reader;
conn5.Open();
reader = cmd5.ExecuteReader();
while (reader.Read())
{
AdminMultiview.SetActiveView(AdminMainPage);
}
reader.Close();
conn5.Close();
}
catch (Exception ex)
{
lblWrong.Text = "Please check your Login ID and Password again.
";
lblWrong.Text += ex.Message;
}
}
anybody can help me