I've got a TSQL view which looks like this
In my VB.Net application, I have a ComboBox which uses the above as its datasource. The reason I've used the view rather than just bind it directly to the table is because I would like the values displayed in the drop-down in the order returned from this view. It is set up like this
SELECT TOP 100 PERCENT --Needed for the ORDER BY clause
But I can't get this to work, the values are still displayed to the user in the order of their SQL primary key value, rather than the order I specified in the ORDER BY clause. Please can anyone suggest what I could be doing wrong?
Dim NHSReasonAdapter As New TopManDataSetTableAdapters.NHSReasonsInOrderTableAdapter
Dim NHSReasonTable As New TopManDataSet.NHSReasonsInOrderDataTable
cmbNHSReason.DataSource = NHSReasonTable
cmbNHSReason.DisplayMember = "Reason"
cmbNHSReason.ValueMember = "NHSReasonID"