S
scurenton
I have a dropdownlist that gets its data from a SQL table. How can I
take the actual text that a user selects and put it to a string.
This is what I tried:
// open my connection
vendorDBconn.open();
//Create a string variable from the selected item in ddl1
string ddlSelection = ddl1.SelectedItem.Text;
//Create SQL statement string to get bidID# where bid_cat_desc is
equal to text selected in ddl1
string SelectID = "SELECT bid_cat_id FROM bid_cat_lookup WHERE
bid_cat_desc = '" + ddlSelection + "'";
No need to keep typing because when I add a break point at "string
ddlSelection..... and step through it I can see that the ddl
selection is not going into the string var ddlSelection. How do I
properly do this. Any example would be appreciated. Thanks[/code]
take the actual text that a user selects and put it to a string.
This is what I tried:
// open my connection
vendorDBconn.open();
//Create a string variable from the selected item in ddl1
string ddlSelection = ddl1.SelectedItem.Text;
//Create SQL statement string to get bidID# where bid_cat_desc is
equal to text selected in ddl1
string SelectID = "SELECT bid_cat_id FROM bid_cat_lookup WHERE
bid_cat_desc = '" + ddlSelection + "'";
No need to keep typing because when I add a break point at "string
ddlSelection..... and step through it I can see that the ddl
selection is not going into the string var ddlSelection. How do I
properly do this. Any example would be appreciated. Thanks[/code]