Tim
Tim

Reputation: 1239

Dropdownlist with sqldatareader

my dropdownlist HTML5

<select runat="server" id="ddlStateLegalRes" name="ddlStateLegalRes"></select>

On my page load I am binding my dropdownlist to a list collection with a list of states

Original question was answered created a new question as it is a different erorr

Upvotes: 2

Views: 90

Answers (1)

hutchonoid
hutchonoid

Reputation: 33305

If I understand the question correctly you need to do this:

ddlStateLegalRes.Items.FindByValue(sdr["STATEOFLEGALRESIDENCE"].ToString()).Selected = true;

Upvotes: 1

Related Questions