Solved

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

Posted on 2016-08-25
3
44 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
Comment Utility
What about this?

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

Open in new window

0
 

Author Comment

by:zachvaldez
Comment Utility
thanks
0
 

Author Closing Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Article by: Ivo
Anonymous Types in C# by Ivo Stoykov Anonymous Types are useful when  we do not need to follow usual work-flow -- creating object of some type, assign some read-only values and then doing something with them. Instead we can encapsulate this read…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now