• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 64
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

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