Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics 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 3rd, 2011, 09:20 AM
Registered User
 
Join Date: May 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default sessionParameter for SUB-selection, inflicts on primary selection

In a Gridview I have a column displaying number of entries in another table with ref.keys to the primary table.
The problem occurs when trying to pick only subtable entries visible for the specific user. Allthough the sessionParameter is only reffered to in the sub-select clause, the datagrid becomes empty when the "ses_user" sessionParameter is declared. Remove the parameter with sub-select reference and data is back.
Anyone who sees the logic of this or have a workaround?

Code:
    <asp:SqlDataSource ID="SqlDataSourceGrid" runat="server"   ConnectionString="<%$ ConnectionStrings:GTTConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:GTTConnectionString.ProviderName %>" 
        SelectCommand="SELECT  [Populasjon],  [Aar], [Mnd], [Mnd_Halvdel], [PasientNr], [JournalNr], [Liggedager] ,(select count(*) from DBO.DataTriggere tr where tr.PasientNr=pas.PasientNr and userName=@ses_user) nTriggers FROM [DBO].[DataPasienter] pas
    where pas.Aar=@valgt_aar and pas.mnd=@valgt_mnd and mnd_halvdel=@mnd_halvdel"
        <SelectParameters>
            <asp:ControlParameter ControlID="DropDownListAar" Name="valgt_aar" PropertyName="SelectedValue" />
            <asp:ControlParameter ControlID="DropDownListMnd" Name="valgt_mnd" PropertyName="SelectedValue" />
            <asp:ControlParameter ControlID="DropDownListMndHalvdel" Name="Mnd_Halvdel" PropertyName="SelectedValue" />
            <asp:SessionParameter Name="Ses_user"  SessionField="userName" />
        </SelectParameters>

Last edited by Aung; May 4th, 2011 at 03:03 AM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Selection in DataGrid Ardvisoor ASP.NET 2.0 Professional 3 June 14th, 2006 09:23 AM
No selection for a parameter krema Reporting Services 1 February 23rd, 2006 07:30 AM
Range selection keithd Excel VBA 7 April 7th, 2005 11:29 AM
Date Selection gmoney060 Classic ASP Basics 2 September 3rd, 2004 07:01 PM
Exclusive selection RobbieGee MySQL 2 July 5th, 2004 04:35 PM





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