• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 60
  • Last Modified:

How to add an item to dropdown list? need to correct?

while dr(.Read())

  {
Unitlocation qlocation = new Unitlocation();
qlocation.slocation = rdr["UNIT"].ToString();
listlocations.Add(qlocation);

when I debug this..qlocation has value of "Emply.PersonDb"...
qlocation.slocation has the string value I need to display

It does not take code listlocations.Add(qlocation.slocation)..

In debug mode there is a wrench icon for slocation value..
I used VS 2015
0
zachvaldez
Asked:
zachvaldez
  • 2
1 Solution
 
Jeff DarlingDeveloper AnalystCommented:
What about this?

listlocations.Add(rdr["UNIT"].ToString());

Open in new window

0
 
zachvaldezAuthor Commented:
thanks
0
 
zachvaldezAuthor Commented:
yeah! I thought I closed this already. I didn't realize EE modify the process to close question. Pretty clever though!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now