Wrox Programmer Forums
|
BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9
This is the forum to discuss the Wrox book Professional ASP.NET 2.0 Special Edition by Bill Evjen, Scott Hanselman, Devin Rader, Farhan Muhammad, Srinivasa Sivakumar; ISBN: 9780470041789
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 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 May 19th, 2007, 06:32 AM
Registered User
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Web Page

Hi Friends

I want to display the data of two fields of two different table in a dropdown list collectively.
Just give mr rough idea.

Thanks
 
Old May 22nd, 2007, 09:49 AM
Registered User
 
Join Date: Mar 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to bignermo
Default

Hi, first you must iterate through the retrieved data

ArrayList arrayListTableONE = new ArrayList();
ArrayList arrayListTableTWO = new ArrayList();


while(readerONE.Read())
{
  arrayListTableONE.Add(reader["fieldName"].ToString());
}

while(readerTWO.Read())
{
  arrayListTableTWO.Add(reader["fieldName"].ToString());
}

then use the for loop and iterate through the data from two lists
and joint its string data:

for(int i = 0; i<arrayListTableTWO.Length; i++)
{
  dropDownList.Items.Add(arrayListTableONE[i].ToString() + "---" + arrayListTableTWO.ToString());
}

I hope it helps!






Similar Threads
Thread Thread Starter Forum Replies Last Post
how to prevent a web page/window page from copying pradeeppatnaik81 C# 2 April 9th, 2008 03:36 AM
How to diplay web page inside another web page win cyberjoe C# 2 March 1st, 2007 05:35 AM
Saving a Web Page riggs Excel VBA 7 November 30th, 2006 04:59 AM
printing from a web page badgolfer ASP.NET 1.0 and 1.1 Basics 4 January 28th, 2005 12:07 PM
How to format web page to a printable page? peter2004 HTML Code Clinic 2 May 3rd, 2004 01:34 PM





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