DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Fri, 17 Aug 2007 22:31:21 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Julien Sobrier
          2    Masudur
          3    Julien Sobrier


Problem with 2 SqlDataSource   
Hello,
I have 2 SqlDataSource on the same page that retrieve the same column names:

<asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a, b FROM c WHERE d = 0 />

<asp:SqlDataSource ID="SqlSons" runat="server"
SelectCommand="SELECT a, b  FROM c WHERE d = 74" />

The problem is that Eval("a") always return the value from SqlStructure.
 I tried to change the query to "SELECT a AS x, b AS Y  FROM c WHERE d =
74" but Eval("Y") returns an error.

The ultimate goal is to have something like this:

<asp:SqlDataSource ID="SqlStructure" runat="server"
  SelectCommand="SELECT a, b FROM c WHERE d = 0 />

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlStructure" />
    <ItemTemplate>
        <h2><%# Eval("b")%></h2>

        <asp:SqlDataSource ID="SqlStructure" runat="server"
          SelectCommand="SELECT a AS X, b AS Y FROM c WHERE d = <%#
Eval('a') %> />

	<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlSons" />
            <ItemTemplate>
            <p><%# Eval("b AS Y")%></p>
            <ItemTemplate>
        </asp:Repeater>
    </ItemTemplate>
</asp:Repeater>


Thank you
Julien
Date:Fri, 17 Aug 2007 22:31:21 -0700   Author:  

Re: Problem with 2 SqlDataSource   
Hi...
.........
-> <asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a AS X, b AS Y FROM c WHERE d = <%# Eva('a')  />
-> <asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlSons" /

>


why the datasource id of the inner repeater is sqlSons... and in
sqldatasource it is said SqlStructure ?


Thanks
Masudur
Date:Sat, 18 Aug 2007 08:59:35 -0000   Author:  

Re: Problem with 2 SqlDataSource   
Masudur wrote:

> Hi...
> ........
> -> <asp:SqlDataSource ID="SqlStructure" runat="server"
> SelectCommand="SELECT a AS X, b AS Y FROM c WHERE d = <%# Eva('a')  />
> -> <asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlSons" /
> 
> why the datasource id of the inner repeater is sqlSons... and in
> sqldatasource it is said SqlStructure ?
> 
> 
> Thanks
> Masudur
> 



I have 2 SqlDataSource (SqlStructure and SqlSons) which are both used:

<asp:SqlDataSource ID="SqlStructure" runat="server"
SelectCommand="SELECT a, b FROM c WHERE d = 0 />

<asp:SqlDataSource ID="SqlSons" runat="server"
SelectCommand="SELECT a, b  FROM c WHERE d = 74" />

The problem is that Eval("a") always return the value from SqlStructure.
 I tried to change the query to "SELECT a AS x, b AS Y  FROM c WHERE d =
74" but Eval("Y") returns an error.

The ultimate goal is to have something like this:

<asp:SqlDataSource ID="SqlStructure" runat="server"
  SelectCommand="SELECT a, b FROM c WHERE d = 0 />

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlStructure" />
    <ItemTemplate>
        <h2><%# Eval("b")%></h2>

        <asp:SqlDataSource ID="SqlStructure" runat="server"
          SelectCommand="SELECT a AS X, b AS Y FROM c WHERE d = <%#
Eval('a') %> />

	<asp:Repeater ID="Repeater2" runat="server" DataSourceID="SqlSons" />
            <ItemTemplate>
            <p><%# Eval("b AS Y")%></p>
            <ItemTemplate>
        </asp:Repeater>
    </ItemTemplate>
</asp:Repeater>
Date:Sat, 18 Aug 2007 09:07:21 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us