R
Ruchika Chadha via .NET 247
(Type your message here)
Hi guys,
I am new to ASP .NET. I have used the following code to add values from a database to a combobox:-
Dim index As Integer = 0
For Each dRows In dSet.Tables(tableName).Rows
comboBoxName.Items.Insert(index, dRows.Item(columnName))
index += 1
Next
The above gives me the following HTML output:-
<select name="cbox" id="cbo_cbo" style="width:152px;">
<option value="ABC">ABC</option>
<option value="DEFG">DEFG</option>
</select>
Is there a way to have different values for - "Text" and "Value" in the combobox. For example - how can i produce
<select name="cbox" id="cbo_cbo" style="width:152px;">
<option value="1">ABC</option>
<option value="2">DEFG</option>
</select>
Thanks in advance!!!
cheers
Ruchika (Richi)
Hi guys,
I am new to ASP .NET. I have used the following code to add values from a database to a combobox:-
Dim index As Integer = 0
For Each dRows In dSet.Tables(tableName).Rows
comboBoxName.Items.Insert(index, dRows.Item(columnName))
index += 1
Next
The above gives me the following HTML output:-
<select name="cbox" id="cbo_cbo" style="width:152px;">
<option value="ABC">ABC</option>
<option value="DEFG">DEFG</option>
</select>
Is there a way to have different values for - "Text" and "Value" in the combobox. For example - how can i produce
<select name="cbox" id="cbo_cbo" style="width:152px;">
<option value="1">ABC</option>
<option value="2">DEFG</option>
</select>
Thanks in advance!!!
cheers
Ruchika (Richi)