protected void DataGridProcessList_PageIndexChanged(Object sender, DataGridPageChangedEventArgs e) { // Set CurrentPageIndex to the page the user clicked. DataGridProcessList.CurrentPageIndex = e.NewPageIndex; DataGridProcessList.DataSource = new DataView(ViewState["ProcessList"] as DataTable); DataGridProcessList.DataBind(); }
private void ShowProcessList() { try { int serverId = (int)ViewState[WebConfig.ParamServerId]; GameServer server = TheAdminServer.GameServerManager.GetGameServer(serverId); if (server == null) { LabelOpMsg.Text = string.Format(StringDef.MsgCannotBeNone, StringDef.GameServer); return; } if (!server.IsConnected) { LabelOpMsg.Text = StringDef.NoConnectionAlert; return; } string cmdText = "Show processlist;"; SqlResult result = WebUtil.QueryGameServerDb(CurrentUser.Id, server, new SqlCommand(cmdText, null)); if (result != null && result.Success) { DataGridProcessList.DataSource = CreateProcessListDataSource(result); DataGridProcessList.DataBind(); } else { LabelOpMsg.Text = StringDef.OperationFail; return; } } catch (Exception) { } }