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: Sat, 18 Aug 2007 11:58:43 -0700,    posted on: microsoft.public.dotnet.framework.aspnet        back       

Thread Index
  1    Julien Sobrier
          2    Julien Sobrier


problem parameters in sqldatasource   
Hello,
I'm facing a very simple problem. This DataSource returns the right result:
<asp:SqlDataSource ID="SqlSons" runat="server" EnableCaching=true
             SelectCommand="SELECT no, titrefr FROM structure WHERE
parent= 74ORDER BY no DESC" />

But when I try to use an SalParameters, there is no result:
<asp:SqlDataSource ID="SqlSons" runat="server" EnableCaching=true
             SelectCommand="SELECT no, titrefr FROM structure WHERE
parent= @Parent ORDER BY no DESC" >
    <SelectParameters>
        <asp:Parameter Name="Parent" DefaultValue="74" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>

Is there an additional step needed for the SqlDataSource to replace
@Parent by the DefaultValue of the Select Parameter Parent?


The "full" code is this:

<asp:SqlDataSource ID="SqlSons" runat="server" EnableCaching=true
             SelectCommand="SELECT no, titrefr FROM structure WHERE
parent= @Parent ORDER BY no DESC" >
    <SelectParameters>
        <asp:Parameter Name="Parent" DefaultValue="74" Type="Int32" />
    </SelectParameters>
</asp:SqlDataSource>

<ol>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlSons">
  <ItemTemplate>
    <li><%# Eval("titrefr") %></li>
  </ItemTemplate>
</asp:Repeater>
</ol>

Thank you
Julien
Date:Sat, 18 Aug 2007 11:58:43 -0700   Author:  

Re: problem parameters in sqldatasource   
Julien Sobrier wrote:

> Hello,
> I'm facing a very simple problem. This DataSource returns the right result:
> <asp:SqlDataSource ID="SqlSons" runat="server" EnableCaching=true
>              SelectCommand="SELECT no, titrefr FROM structure WHERE
> parent= 74ORDER BY no DESC" />
> 
> But when I try to use an SalParameters, there is no result:
> <asp:SqlDataSource ID="SqlSons" runat="server" EnableCaching=true
>              SelectCommand="SELECT no, titrefr FROM structure WHERE
> parent= @Parent ORDER BY no DESC" >
>     <SelectParameters>
>         <asp:Parameter Name="Parent" DefaultValue="74" Type="Int32" />
>     </SelectParameters>
> </asp:SqlDataSource>
> 
> Is there an additional step needed for the SqlDataSource to replace
> @Parent by the DefaultValue of the Select Parameter Parent?


I didn't realize that with MySQL, I need to use ? instead of @
Date:Sat, 18 Aug 2007 20:14:04 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


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