public void getdata() { SqlCommand cmd = new SqlCommand("Usp_MTDgetroles", con); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables.Contains("Table") == true) { if (ds.Tables[0].Rows.Count > 0) { GVRoles.DataSource = ds.Tables[0]; GVRoles.DataBind(); } } }
public void getdata(string UserID) { SqlCommand cmd = new SqlCommand("usp_getallusers", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@UserID", UserID); SqlDataAdapter da = new SqlDataAdapter(); da.SelectCommand = cmd; DataSet ds = new DataSet(); da.Fill(ds); if (ds.Tables.Contains("Table") == true) { if (ds.Tables[0].Rows.Count > 0) { GVRoles.DataSource = ds.Tables[0]; GVRoles.DataBind(); } } }
protected void BindRoleGrid() { GVRoles.DataSource = Roles.GetAllRoles(); GVRoles.DataBind(); }