Solved

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

Posted on 2016-08-25
3
53 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
  • 2
3 Comments
 
LVL 12

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 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