[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Using DataSet values for variables

Posted on 2005-04-08
Medium Priority
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 land_quotes.coverlevel=land_coverlevel.id" %>'
<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

Accepted Solution

alexhogan earned 500 total points
ID: 13754228
You have to start a session and initialize the session value...

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

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


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month20 days, 8 hours left to enroll

868 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