Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Populate DropDown with LINQ

Posted on 2010-11-29
5
Medium Priority
?
480 Views
Last Modified: 2012-05-10
Just starting to work with LINQ.  I want to populate a dropdown from a table that contains two fields: Role and Role_ID_pk.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        ' Populate the Ticket Master Role DropDown
        ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
        Using myDataContext As New TicketStoreDataContext()
            Dim AllTicketMasterRoles = From Ticket_Master_Role In myDataContext.TICKET_MASTER_ROLEs _
                                       Select Ticket_Master_Role.Role, Ticket_Master_Role.Role_ID_pk

            Dim ddTicketMasterRoles As New DropDownList
            ddTicketMasterRoles = CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("ddTicketMasterRoles")
            ddTicketMasterRoles.DataSource = AllTicketMasterRoles
            ddTicketMasterRoles.DataTextField = ?????????
            ddTicketMasterRoles.DataValueField = ????????
            ddTicketMasterRoles.DataBind()

        End Using

Open in new window

0
Comment
Question by:rrhandle8
[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
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
Kumaraswamy R earned 500 total points
ID: 34236511
0
 

Author Comment

by:rrhandle8
ID: 34236524
Already read all three.  No help.
0
 
LVL 2

Expert Comment

by:getnitincr
ID: 34236526
0
 

Author Comment

by:rrhandle8
ID: 34236539
Oops!  I did not read the last one: http://social.msdn.microsoft.com/forums/en-US/linqprojectgeneral/thread/f52f7a08-6a9e-4cd8-81e6-6f5dc3104169/ 
Just added the field names.

            ddTicketMasterRoles.DataTextField = "Role"
            ddTicketMasterRoles.DataValueField = "Role_ID_pk"
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

618 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