protected void CmdUserRights_Click(object sender, ImageClickEventArgs e) { StrSql = "Select Name from Sys.tables"; StrSql = StrSql + " Where Name='" + "User_" + CboUserId.Text + "'"; DataSet rs = (DataSet)MethodClass.ConnectionToQuery(StrSql); if (rs.Tables[0].Rows.Count <= 0) { StrSql = "Select * from User_Administrator"; StrSql = StrSql + " Order by serial_no asc"; DataSet rs2 = (DataSet)MethodClass.ConnectionToQuery(StrSql); GvUserPrivilege.DataSource = rs2.Tables[0]; GvUserPrivilege.DataBind(); } else { StrSql = "Select * from " + "[User_" + CboUserId.Text + "]"; StrSql = StrSql + " Order By serial_no asc "; DataSet rs4 = (DataSet)MethodClass.ConnectionToQuery(StrSql); if (rs4.Tables[0].Rows.Count > 0) { GvUserPrivilege.DataSource = rs4.Tables[0]; GvUserPrivilege.DataBind(); foreach (GridViewRow rows in GvUserPrivilege.Rows) { CheckBox ChkBoxRows = (CheckBox)rows.FindControl("chk"); ChkBoxRows.Checked = true; } } else { } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)