Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
| Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 10th, 2006, 08:29 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default DataGet with VS 2003 + .NET F2.0

I have a question on how to make a Dropdown list box from a dataset that can display related table's value and make a selection

Thanks

  #2 (permalink)  
Old March 10th, 2006, 08:31 AM
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sorry..I mean Visual studio 2005

thanks

  #3 (permalink)  
Old March 13th, 2006, 02:30 PM
Authorized User
 
Join Date: Mar 2006
Location: , , .
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Victor,

I am not very sure if I got your question correctly. Did you mean to ask: "How can I populate the elements a DropDownList from one table (Table1) and be able to set/get the displayed element from another table (Table2)?"

To do this,
1) Set the DisplayMember of the combobox to the appropriate field from Table1.

2) Set the ValueMember to the appropriate field from Table1

3) Set the SelectedValueMember to the appropriate field from Table2.

NOTE: Make sure that SelectedValue is contained in the Values, to avoid any runtime surprises! That is, if Names is Table1 and ValueMember column in Names.nameID and if Grades is Table2, I would use Grades.nameID as the SelectedValueMember


HTH
Sreeram


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conversion from .Net 2003 to .Net 2005 using VB.Ne coleenh Visual Basic 2005 Basics 0 September 19th, 2006 02:48 PM
how do i assign keypress event on F2 kau_shuk VS.NET 2002/2003 1 August 25th, 2006 08:49 PM
Can I run VB .net 2005 with DOT NET 2003 APPLICATI kadesskade BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 August 8th, 2006 05:14 AM
Why getElementById("f2").style vinod_yadav1919 Javascript How-To 2 January 18th, 2005 11:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.