Using DataSet values for variables

Posted on 2005-04-08
Last Modified: 2010-04-25
Hi. I'm sure this is really simply, but it's driving me crazy! I have a Dreamweaver ASP.Net page that contains a dataset. Here's the code for that:

ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_STRING_aspxconn") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("MM_CONNECTION_DATABASETYPE_aspxconn") %>'
CommandText='<%# "SELECT land_coverlevel.compuls_prem1, land_coverlevel.compuls_prem2  FROM land_coverlevel, land_quotes  WHERE land_quotes.quote_id = @thisquote AND" %>'
<Parameter  Name="@thisquote"  Value='<%# IIf((Not Session("thisquote") Is Nothing), Session("thisquote"), "0") %>'  Type="Int"   /></Parameters></MM:DataSet>

That works fine. I can display the values by literally just dragging them into the page. The code that does this is:

The price is: <%# pricecalc.FieldValue("compuls_prem1", Container) %>

My problem is, I need to set a session variable using the same value, something like:

<%Session("ThisSession") = pricecalc.FieldValue("compuls_prem1", Container)

but it doesn't work. I can't even Response.Write it.

Any thoughts?


Question by:mfrater
    1 Comment
    LVL 8

    Accepted Solution

    You have to start a session and initialize the session value...

    In C#
    void Session_Start() {
        Session["This Session"] = pricecalc.FieldValue("compuls_prem1", Container);

    In VB
    Sub Session_Start()
        Session["This Session"] = pricecalc.FieldValue("compuls_prem1", Container)
    End Sub


    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
    Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
    This video discusses moving either the default database or any database to a new volume.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now