public void userValidate(string sqlStr){DBConnection.Con.Open();//數(shù)據(jù)庫的連接類打開try{SqlCommand sqlselect = new SqlCommand(sqlStr, DBConnection.Con);int i = (int)sqlselect.ExecuteScalar();if (i == 1){this.Hide();DBConnection.Con.Close();string sqlcmd = string.Format("select * from Roles where rolename='{0}'", genre());FrmMian frmmian = new FrmMian(sqlcmd);frmmian.Show();}else{MessageBox.Show("用戶不存在或密碼錯誤", "錯誤", MessageBoxButtons.OK, MessageBoxIcon.Error); txtPwd.Clear(); txtUserName.Clear(); txtUserName.Focus();}}catch (SqlException ex){MessageBox.Show(ex.Message);}finally{DBConnection.Con.Close();}}
int i = (int)sqlselect.ExecuteScalar();中i是什么意思?
叮當(dāng)貓咪
2019-02-06 15:07:57