dataset 登录
(2010-11-25 08:44:45) private void button6_Click(object sender, EventArgs e)
{
DataTable db = SQLHelper.ExecuteReader("select * from T_Users where UserName = @UserName",new SqlParameter("UserName",txtUserName.Text));
if (db.Rows.Count <= 0)
{
MessageBox.Show("用户名不存在!");
return;
}
else
{
DataRow row = db.Rows[0];
int errorTimes = Convert.ToInt32(row["ErrorTimes"]);
if (errorTimes >= 3)
{
MessageBox.Show("错误次数过多!禁止登录!!!");
return;
}
string password = Convert.ToString(row["Password"]);
if (txtPassword.Text == password)
{