TheBugSlayer
Programmer
I have the following code in my Sub:
The Practice_Code and Practice_Description columns are added at design time and are the only ones I want visible.
The table contains 32 fields, however Schema.Rows only contains 23 rows, in other words, the listview only has 23 columns. Is there a limit in the number of column headers?
I am trying to have the dataset stay in memory somehow. Since there is already a listview containing the records, I did not want to persist the data reader.
Any help is appreciated.
Code:
[COLOR=green]
...
Dim dr As IDataReader = db.ExecuteReader(db.GetStoredProcCommand("p_MyTable_SELECT"))
If dr.Read() Then
If IsFirstLoad Then
Dim Schema As System.Data.DataTable = dr.GetSchemaTable()
Dim Row As DataRow
For Each Row In Schema.Rows
If Row("ColumnName") <> "Practice_Code" And _
Row("ColumnName") <> "Practice_Description" Then
Dim h As New ColumnHeader
h.Text = Row("ColumnName")
h.Tag = Row("ColumnName")
h.Width = Convert.ToInt32(Row("ColumnSize"))
lvPractices.Columns.Add(h)
End If
Next
IsFirstLoad = False
End If
...
[/color]
The Practice_Code and Practice_Description columns are added at design time and are the only ones I want visible.
The table contains 32 fields, however Schema.Rows only contains 23 rows, in other words, the listview only has 23 columns. Is there a limit in the number of column headers?
I am trying to have the dataset stay in memory somehow. Since there is already a listview containing the records, I did not want to persist the data reader.
Any help is appreciated.