J
Jim
Creating a datagridView with a dataReader. Why do I get this message
when I click on the column header (some, but not all the column
headers) to sort??
sqlDR = sqlCMD.ExecuteReader
Dim intCol As Integer
With sqlDR
If .HasRows Then
DataGridViewProducts.Rows.Clear()
For intCol = 0 To .FieldCount - 1
DataGridViewProducts.Columns.Add(.GetName(intCol),
..GetName(intCol))
Next
DataGridViewProducts.AutoSizeColumnsMode =
DataGridViewAutoSizeColumnsMode.ColumnHeader
While .Read
Dim objCells(intCol) As Object
.GetValues(objCells)
DataGridViewProducts.Rows.Add(objCells)
End While
.Close()
End If
End With
when I click on the column header (some, but not all the column
headers) to sort??
sqlDR = sqlCMD.ExecuteReader
Dim intCol As Integer
With sqlDR
If .HasRows Then
DataGridViewProducts.Rows.Clear()
For intCol = 0 To .FieldCount - 1
DataGridViewProducts.Columns.Add(.GetName(intCol),
..GetName(intCol))
Next
DataGridViewProducts.AutoSizeColumnsMode =
DataGridViewAutoSizeColumnsMode.ColumnHeader
While .Read
Dim objCells(intCol) As Object
.GetValues(objCells)
DataGridViewProducts.Rows.Add(objCells)
End While
.Close()
End If
End With