Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 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 February 9th, 2005, 02:11 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 218
Thanks: 0
Thanked 0 Times in 0 Posts
Default Adding Two Tables to a DataView

I have a function that returns a DataView that is derived from a dataset table. I need to have a second set of data appended to the end of the first table.

What I have now is:
Code:
Function GetCounselorList() As DataView
        Dim dsLookups As DataSet
        Dim thisCase As New clsCase
        Dim Counselors As DataView

        dsLookups = thisCase.GetLookups
        Counselors = dsLookups.Tables("Counselors").DefaultView
        Counselors.AllowNew = True

        Return Counselors
End Function
I am using this to populate a dropdown list. I need to add another table to the bottom of the list with this second table:
Code:
dsLookups.Tables("InactiveCounselors").DefaultView
Thanks in advance for your comments.

- - - - - - - - - - - - - - - - - - - - - - -
In God we trust, everything else we test.
 
Old February 9th, 2005, 05:26 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

get them in the same query (one table)

Ahmed Ali
Software Developer
 
Old February 9th, 2005, 06:45 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'm not sure but I think alyeng2000's way is not applicable because DataColumn doesn't implement ICollection and because in your case you want to populate a DropDownList,just you can set the DataSource of your DropDown with one column...so even if you do something like this,you cant get your result,
Code:
ArrayList ar=new ArrayList();
ar.AddRange(dv1);
ar.AddRange(dv2);
in your case for a DropDownList the only way I think you can is iterating through all elements in your DataViews and assigning them to one unique arraylist then set the DataSource of your DropDown to the arraylist,
(I meant from elements ds.Tables["Counselors"].Rows[FixedNumber][j] and ds.Tables["InactiveCounselors"].Rows[Fixed][k]).

_____________________________
Mehdi.
software engineering student.
Looking for a good job for summer 2005.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Webshop adding tables. Rebel BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 25 October 28th, 2007 09:28 AM
dataview Yasho VB.NET 2002/2003 Basics 1 May 28th, 2007 03:40 AM
Creat a dataview and dvlop relaton betwn 2 tables dhol General .NET 5 August 11th, 2005 06:46 AM
Adding records to Tables lgpatterson Access VBA 6 March 20th, 2005 07:23 AM
delay in adding tables kondapally Crystal Reports 0 January 12th, 2005 02:27 PM





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