Please Help With SessionParameter

Apr 18, 2007

I am trying to set the SessionField from the codebehind, but it's not picking it up. What is the proper syntax here? Can I assign SessionField like this? I don't get an error but the Session is not read

        <asp:SqlDataSource ID="SqlDataSource1" runat="server" CancelSelectOnNullParameter="false" ConnectionString="<%$ ConnectionStrings:MedIT %>"
            SelectCommand="usp_customer_get" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:SessionParameter Name="customerID" SessionField="<%= sessionCustomerID %>" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>

View 3 Replies


ADVERTISEMENT

Asp:SessionParameter

May 27, 2008

 Hello, In <asp:SqlDataSource> I need to do a request, something like that: SelectCommand="Select Fecha,FijoKwh,Kwh,FijoAgua,Litro From Precios Where NInstalacion=@instal">@instal is a variable that I need to get from Session State, it is an integer. I have been looking throughtout the theory but I havenĀ“t understood how to link this variable to this Session.Could anyone help me with this?Thank you. 

View 5 Replies View Related

How To Set SessionParameter And QueryStringParameter Both In SelectParameters Of SQLDataSource.

Mar 14, 2008

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CollegeDatabaseConnectionString %>"                 SelectCommand="SELECT employee_datails.* FROM employee_datails WHERE memberid !=@id OR memberid OR memberid==uid">        <SelectParameters>                 <asp:SessionParameter Name="id" SessionField="userid" />                <asp:QueryStringParameter Name="uid" QueryStringField="memberid" />       </SelectParameters>    </asp:SqlDataSource> I tried like this but it is not working. It takes at a time one sessionparameter or querystringparameter. I want if profile.aspx--> then i want session parameter in select queryIf profile.aspx?id=12432---> then i want  querystringparameter in select query.

View 2 Replies View Related

[:'(]Interesting &<asp:SessionParameter Name=dtdate1 SessionField=dtdate1 Type=DateTime/&>

Jun 27, 2006

    <asp:SqlDataSource ID="SqlDataSource1" runat="server"    ConnectionString="<%$ ConnectionStrings:Ales %>"     SelectCommand="Select * From HSeason"    >        <SelectParameters>            <asp:SessionParameter Name="hotelID"  SessionField="hotelID"/>           <asp:SessionParameter Name="dtdate1" SessionField="dtdate1"  Type="DateTime"/>                   </SelectParameters>    </asp:SqlDataSource>        <asp:GridView ID="GridView1"  DataSourceID="SqlDataSource1" runat="server">    </asp:GridView>When I delete <asp:SessionParameter Name="dtdate1" SessionField="dtdate1"  Type="DateTime"/>everythig works I am defining protected void Page_Load(object sender, EventArgs e)    {        Session["hotelID"] = "1";        Session["dtdate_1"] = DateTime.Now;    }What could be the problem the datetime session just doesnt work??? Even when I dont use it at all in SelectCommand

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved