Wrox Programmer Forums
.NET Framework 1.x For discussing versions 1.0 and 1.1 of the Microsoft .NET Framework.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Framework 1.x 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
Old October 16th, 2007, 04:47 AM
Registered User
Join Date: Oct 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dropdownlist

Hi All.

Can i get the values of two tables in dropdownlist??
I have two tables , table1, table2. both has one, one feilds.

table1.name1 and table2.name2.

I want to show values of name1, name2 in the dropdownlist control.

Can some one help me please.


Old January 9th, 2008, 11:03 PM
Registered User
Join Date: Jan 2008
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to anystayisjk

while (Reader.Read())
test.SelectedValue= Reader["xxxx"].ToString(); //table0.name of field
test.SelectedValue= Reader["xxxx"].ToString(); //teble1.name of field

Old February 15th, 2008, 10:51 AM
Registered User
Join Date: Feb 2008
Posts: 5
Thanks: 0
Thanked 1 Time in 1 Post

You can use a dataset to combine the values of the 2 tables using a valid query.Then bing the control to the dataset.This can help in cases where the two tables have datarelations

Similar Threads
Thread Thread Starter Forum Replies Last Post
dropdownlist sumith ASP.NET 1.0 and 1.1 Professional 1 February 23rd, 2007 09:11 AM
DropdownList Venkatesan ASP.NET 1.0 and 1.1 Basics 1 December 11th, 2006 11:03 AM
how to get value from dropdownlist vandat ASP.NET 1.0 and 1.1 Basics 3 November 28th, 2005 12:47 AM
DropDownList chiraagb VS.NET 2002/2003 5 June 15th, 2004 03:12 AM

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