A
AMDRIT
I have a table [CoverageLimits] with the following columns
Coverage, Limit, LimitDescription, PerPerson, PerAccident
I load the data from a stored procedure into a datatable
Select Coverage, Limit, LimitDescription, PerPerson, PerAccident From
CoverageLimits Order By Coverage, PerPerson, PerAccident.
I have manually executed this procedure in Query Analyzer and the data comes
out in the desired order.
'A', 'J', '20/40', 20, 40
'A', 'K', '25/50', 25, 50
'A', 'C', '100/300', 100, 300
While the data is actually stored in the heap in this order
'A', 'K', '25/50', 25, 50
'A', 'C', '100/300', 100, 300
'A', 'J', '20/40', 20, 40
When I attempt to populate a combobox with this data from my datatable
dim drs() as datarow
drs = mydatatable.select("Coverage = '" & A & "'")
cbo.DataSource = drs
cbo.DisplayMember = "LimitDescription"
cbo.ValueMember = "Limit"
The data is displayed in its natural ordered state. So then I attempted to
sort the data in the table
dim drs() as datarow
mydatatable.defaultview.sort = "Coverage, PerPerson, PerAccident"
drs = mydatatable.select("Coverage = '" & A & "'")
cbo.DataSource = drs
cbo.DisplayMember = "LimitDescription"
cbo.ValueMember = "Limit"
The data is still displayed in its natural ordered state. Now I can attempt
to sort the array of datarows, but this seems kind of a wasted step, I would
prefer the data be ordered by my stored procedure.
Anyone have any ideas how I can achieve the desired result?
TIA
Coverage, Limit, LimitDescription, PerPerson, PerAccident
I load the data from a stored procedure into a datatable
Select Coverage, Limit, LimitDescription, PerPerson, PerAccident From
CoverageLimits Order By Coverage, PerPerson, PerAccident.
I have manually executed this procedure in Query Analyzer and the data comes
out in the desired order.
'A', 'J', '20/40', 20, 40
'A', 'K', '25/50', 25, 50
'A', 'C', '100/300', 100, 300
While the data is actually stored in the heap in this order
'A', 'K', '25/50', 25, 50
'A', 'C', '100/300', 100, 300
'A', 'J', '20/40', 20, 40
When I attempt to populate a combobox with this data from my datatable
dim drs() as datarow
drs = mydatatable.select("Coverage = '" & A & "'")
cbo.DataSource = drs
cbo.DisplayMember = "LimitDescription"
cbo.ValueMember = "Limit"
The data is displayed in its natural ordered state. So then I attempted to
sort the data in the table
dim drs() as datarow
mydatatable.defaultview.sort = "Coverage, PerPerson, PerAccident"
drs = mydatatable.select("Coverage = '" & A & "'")
cbo.DataSource = drs
cbo.DisplayMember = "LimitDescription"
cbo.ValueMember = "Limit"
The data is still displayed in its natural ordered state. Now I can attempt
to sort the array of datarows, but this seems kind of a wasted step, I would
prefer the data be ordered by my stored procedure.
Anyone have any ideas how I can achieve the desired result?
TIA