122
'totalRecords = tempDataSet.Tables[0].Rows.Count
totalRecords = tempDataSet.Tables(0).Rows.Count
tempDataSet.Clear()
tempDataSet.Dispose()
adapter.Fill(ds, 0, 1, "Department")
usertable = ds.Tables("Department")
For Each dc In usertable.Columns
Dim column As New DataGridViewTextBoxColumn
column.DataPropertyName = dc.ColumnName
column.HeaderText = dc.ColumnName
column.Name = dc.ColumnName
column.SortMode = DataGridViewColumnSortMode.Automatic
column.ValueType = dc.DataType
DGVDepartment.Columns.Add(column)
Next
DGVDepartment.Columns.Item(0).Visible = False
DGVDepartment.Columns.Item(1).Width = DGVDepartment.Width
DGVDepartment.Columns.Item(1).HeaderText = "Название отдела"
'CreateTempTable(0, int.Parse(cmbNoOfRecords.Text.Trim()));
usertable.Rows.Clear()
adapter.Fill(ds, 0, totalRecords, "Department")
usertable = ds.Tables("Department")
DGVDepartment.DataSource = usertable.DefaultView
DGVDepartment.AllowUserToResizeColumns = True
'end createtemp
Catch ex As Exception
MsgBox(ex.ToString())
End Try
connection.Close()
'end