M
mervyntracy
Hi There,
I have recently started coding in asp.net (just 2 and a half days
now). I am writing a simple test app that gets data from a data base
and displays the value perfectly in the drop down list. However, each
display value is simply that - a display value and is pretty useless
to me further down the line unless I use the value as part of a select
to get the the key of the record. This would be inefficent so what I
would like to find out is if there is a way to immediately bind the
key value to the display value on the dropdown list object. This way,
when the value is selected, the user will see the display value but
behind the scene, I immediately have access to the key associated to
the display value. I have looked a a few options but none that I can
see will really help me over come my problem easily and I am sure that
there must be a way to bind the display value and the key to the same
control.
I hope that I have explained myself correctly.
Thanks
Mervyn
Dim manufactureData As MANUFACTURER = New MANUFACTURER()
Dim selectString as String()
selectString = "SELECT MANUFACTURER WITH SUSPENDED #
""Y"""
selectString &= " AND WITH MANUFACTURER_NAME # """""
selectString &= " BY-DSND MANUFACTURER_NAME"
manufactureData.selectFromDatabase(selectString)
While (manufactureData.nextRecord)
If cmdManufacturer.Items.Count = 0 Then
cmdManufacturer.Items.Add("Please Select..")
End If
cmdManufacturer.Items.Add(manufactureData.MANUFACTURE_NAME)
End While
I have recently started coding in asp.net (just 2 and a half days
now). I am writing a simple test app that gets data from a data base
and displays the value perfectly in the drop down list. However, each
display value is simply that - a display value and is pretty useless
to me further down the line unless I use the value as part of a select
to get the the key of the record. This would be inefficent so what I
would like to find out is if there is a way to immediately bind the
key value to the display value on the dropdown list object. This way,
when the value is selected, the user will see the display value but
behind the scene, I immediately have access to the key associated to
the display value. I have looked a a few options but none that I can
see will really help me over come my problem easily and I am sure that
there must be a way to bind the display value and the key to the same
control.
I hope that I have explained myself correctly.
Thanks
Mervyn
Dim manufactureData As MANUFACTURER = New MANUFACTURER()
Dim selectString as String()
selectString = "SELECT MANUFACTURER WITH SUSPENDED #
""Y"""
selectString &= " AND WITH MANUFACTURER_NAME # """""
selectString &= " BY-DSND MANUFACTURER_NAME"
manufactureData.selectFromDatabase(selectString)
While (manufactureData.nextRecord)
If cmdManufacturer.Items.Count = 0 Then
cmdManufacturer.Items.Add("Please Select..")
End If
cmdManufacturer.Items.Add(manufactureData.MANUFACTURE_NAME)
End While