Solved

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

Posted on 2016-08-25
3
54 Views
Last Modified: 2016-09-06
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
Comment
Question by:zachvaldez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
Jeff Darling earned 500 total points
ID: 41770960
What about this?

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

Open in new window

0
 

Author Comment

by:zachvaldez
ID: 41785600
thanks
0
 

Author Closing Comment

by:zachvaldez
ID: 41786412
yeah! I thought I closed this already. I didn't realize EE modify the process to close question. Pretty clever though!
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
pressing download button in c# 7 47
Convert VB web project to C# 3 65
c# deserialize JSON from web service using JsonConvert 9 55
Put File 6 36
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question