HOW TO GET VALUES OF DYNAMICALLY GENERATED DROPDOWNLISTS AND INSERT TO A SINGLE FIELD IN DATABASE

Last Reply 10 days ago By dharmendr

Posted one month ago

Hello Aspeeps,

Im trying to concatenate the values of dynamically generated dropdownlists and insert them into a field in my table in my database.

Below is my aspx dropdownlist being generated

<td>
<asp:DropDownList ID="investigation" runat="server" 
datasourceid="DrugsDataSource" datatextfield="DrgName" datavaluefield="Price" BackColor="#FFCCCC" Height="32px" 
style="text-align: center" Width="145px">
</asp:DropDownList>

</td>

 

 

Below is my vb.net attempt using a for each loop

 

'Begin Dropdown List Value set
For Each itm As String In Items.Items
itemspicked &= itm.ToString
Next
'End dropdown value collection
cmd.Parameters.AddWithValue("@items", itemspicked)

However when i submit the form the items field remains blank. Can anyone spot what im doing wrong and point me to the right direction please. I Would really appreciate it.

You are viewing reply posted by: OpeyemiOg 12 days ago.
Posted 12 days ago

No offence intended. but my recent query is still on my question . i just didnt mention that I was using HtmlTables.

Apologies for not being clear enough.

I hope you can still help with the solution for htmltables.

Kind regards .