private async void LoadData(DatabaseObjectDisplayInfo displayInfo, long pageNum = 1, bool isSort = false) { this.displayInfo = displayInfo; this.pagination.PageNum = pageNum; Table table = displayInfo.DatabaseObject as Table; int pageSize = this.pagination.PageSize; DbInterpreter dbInterpreter = DbInterpreterHelper.GetDbInterpreter(displayInfo.DatabaseType, displayInfo.ConnectionInfo, new DbInterpreterOption()); string orderColumns = ""; if (this.dgvData.SortedColumn != null) { string sortOrder = (this.sortOrder == SortOrder.Descending ? "DESC" : "ASC"); orderColumns = $"{dbInterpreter.GetQuotedString(this.dgvData.SortedColumn.Name)} {sortOrder}"; } string conditionClause = ""; if (this.conditionBuilder != null && this.conditionBuilder.Conditions.Count > 0) { this.conditionBuilder.QuotationLeftChar = dbInterpreter.QuotationLeftChar; this.conditionBuilder.QuotationRightChar = dbInterpreter.QuotationRightChar; conditionClause = "WHERE " + this.conditionBuilder.ToString(); } (long Total, DataTable Data)result = await dbInterpreter.GetPagedDataTableAsync(table, orderColumns, pageSize, pageNum, conditionClause); this.pagination.TotalCount = result.Total; this.dgvData.DataSource = DataGridViewHelper.ConvertDataTable(result.Data); foreach (DataGridViewColumn column in this.dgvData.Columns) { Type valueType = column.ValueType; if (valueType == typeof(byte[]) || valueType.Name == "SqlGeography") { column.SortMode = DataGridViewColumnSortMode.NotSortable; } } if (this.sortedColumnIndex != -1) { DataGridViewColumn column = this.dgvData.Columns[this.sortedColumnIndex]; this.isSorting = true; ListSortDirection sortDirection = this.GetSortDirection(this.sortOrder); this.dgvData.Sort(column, sortDirection); this.isSorting = false; } }