473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Multiple ObjectDataSources returning same field names...

I have a page that has a formview and two repeaters that use separate
objectdatasources. Each objectdatasource returns records that contain
a field named DateAndTime. The problem I'm having is that in the
repeaters the value of the DateAndTime databound label is the value
from the first objectdatasource. Do I need to specify in the label
databinding what objectdatasource to use even though it's specified in
the repeater declaration?

Code:
<asp:FormView ID="fvAppendix1" runat="server"
DataKeyNames="PK_Appendix1ID" DataSourceID="Appendix1DataSource">
....
<asp:Label ID="DateTimeLabel" runat="server" Text='<%#
Bind("DateAndTime") %>'></asp:Label>
....
</asp:FormView>
<asp:Repeater ID="rptAppendix1Readings" runat="server"
DataSourceID="Appendix1ReadingsDataSource"
OnItemDataBound="rptAppendix1Readings_ItemDataBoun d">
....
<asp:Label ID="DateTimeLabel" runat="server" Text='<%#
Bind("DateAndTime") %>'></asp:Label>
....
</asp:Repeater>
<asp:Repeater ID="rptAppendix1PaintStorageReadings" runat="server"
DataSourceID="Appendix1PaintStorageReadingsDataSou rce"
OnItemDataBound="rptAppendix1PaintStorageReadings_ ItemDataBound">
....
<asp:Label ID="DateTimeLabel" runat="server" Text='<%#
Bind("DateAndTime") %>'></asp:Label>
....
</asp:Repeater>
<asp:ObjectDataSource ID="Appendix1DataSource" runat="server"
SelectMethod="GetAppendix1ByAppendix1ID" TypeName="Appendix1BLL">
<SelectParameters>
<asp:QueryStringParameter Name="Appendix1ID"
QueryStringField="Appendix1ID" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="Appendix1ReadingsDataSource" runat="server"
SelectMethod="GetAppendix1ReadingsByAppendix1ID"
TypeName="Appendix1ReadingsBLL">
<SelectParameters>
<asp:QueryStringParameter Name="Appendix1ID"
QueryStringField="Appendix1ID" />
</SelectParameters>
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="Appendix1PaintStorageReadingsDataSource"
runat="server" SelectMethod="GetAppendix1PaintStoragesByAppendix1 ID"
TypeName="Appendix1PaintStoragesBLL">
<SelectParameters>
<asp:QueryStringParameter Name="Appendix1ID"
QueryStringField="Appendix1ID" />
</SelectParameters>
</asp:ObjectDataSource>

-Sean

Aug 14 '07 #1
0 1055

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael Flanagan | last post by:
(Bottom line: I think what I'm looking for is an easy way of changing the case of key values in an array.) I've got code that I'm trying to make agnostic about the underlying database system I'm...
66
by: Darren Dale | last post by:
Hello, def test(data): i = ? This is the line I have trouble with if i==1: return data else: return data a,b,c,d = test()
3
by: adam | last post by:
Hello, I have a MySQL table that has (among other fields) an affiliate_id, affiliate_sub_id, and a response_code field. - affiliate_id stores the unique number of each of my affiliates. -...
7
by: Dr John Stockton | last post by:
What are the best ways of returning multiple results from a subroutine ? I've been using ... return } which is inelegant. I'm used to Pascal's procedure X(const A, B : integer; var C, D :...
3
by: StraightEight | last post by:
Hi, I'm am looking for a little help. I need to create a SQL view which joins a few tables, and I need to return an average for a particular column where a second duplicate ID exists... Heres...
6
by: Stephen Cook | last post by:
Having worked through the problems around enabling the document function using an XmlUrlResolver I started work on building a useful class to hide the intricacies. Trying to generalise the process...
1
by: Phoenix_ver10 | last post by:
I have a mailing list with multiple names going to the same addresses. I need one address with all the names for that address on it. I checked out the example on microsoft's site, but A: It doesn't...
4
by: Morgan | last post by:
Hi - I have a wizard which has about 4 RadioList controls on it, all of which are populated from a data object. As far as best practices go, would it be better to configure a seperate...
1
by: Roberto Nunes | last post by:
Guys, Do you use ObjectDataSources in professional projects? I use three layers in old way. GridView1.DataSource = products; GridView1.DataBind();
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.