Lesson 4: Understanding Web Application State

In this lesson, you will see how to maintain state in ASP.NET, including the various objects you can use to store information for your ASP.NET 2.0 applications.

Duration: 40 minutes, 42 seconds

Date: 28 November 2005

Watch VB video  or  C# video   |   Download VB video  or  C# video   |   Get VB code  or  C# code

Video downloads: WMVWMV | ZuneZune | iPodiPod | PSPPSP | MPEG-4MPEG-4 | 3GP3GP

Comments : 19

Leave a Comment

charlescva : On March 25, 2008 10:57 AM said:

i recieve the following error when using C# to follow this tutorial.

App_Code.cy2wsazk.0.cs

// <auto-generated>

//     This code was generated by a tool.

//     Runtime Version:2.0.50727.1433

//

//     Changes to this file may cause incorrect behavior and will be lost if

//     the code is regenerated.

// </auto-generated>

...

   public virtual string MyNewProperty {

       get {

           return ((string)(this.GetPropertyValue("MyNewProperty")));

       }

       set {

           ****this.SetPropertyValue("MyNewProperty", value);**** Unable to connect to SQL Server database.

       }

   }

I do not understand.   I started a new webpage and followed the directions explicitly.  i do not understand why i am getting this error.

prophetpius : On March 27, 2008 1:38 PM said:

"Unable to connect to SQL Server Database" Check to confirm that the sql service is runnig, also confirm that u specified the correct database name in ur connection string

prophetpius : On March 27, 2008 1:39 PM said:

Please how were u able to download this video??????????????

when i click the download link it does not respond

wleearmitage : On March 27, 2008 11:52 PM said:

I am following along with the VB version and am doing exaclty what is being done in the video. When I get to about 26 minutes we add the following lines to the web.config file:

<anonymousIdentification enabled="true"/>

<profile enabled="true">

    <properties>

<add name="MyNewProperty" allowAnonymous="true"/>

    </properties>

</profile>

When I added this code and ran the project, I get an error saying it cannot find the SQL Server. Up to this point the project has been running fine. And no use of a SQL server has been used.

Any Help?

Lee Armitage

romulusc : On April 02, 2008 7:45 AM said:

Hi,

Check out this link: weblogs.asp.net/.../423703.aspx

romulusc : On April 02, 2008 7:50 AM said:
SATAGE : On April 15, 2008 10:30 AM said:

nice to me i try to see

Yankee : On April 17, 2008 4:51 PM said:

finally a full screen option online. so no download :D

Manmadhan : On April 17, 2008 7:34 PM said:

Can be pretty slow in rushing all page objects.

Soha.Jawabreh : On April 25, 2008 1:09 PM said:

useful video but i felt that I’m lost coz of the too many objects are being used :(

turner03 : On May 09, 2008 3:00 PM said:

I followed the links... and when i got to Step 3, i got confused... does anyone know where you open this?

turner03 : On May 13, 2008 11:10 AM said:

got it now!

imarash : On May 16, 2008 12:34 PM said:

So which one is better to use for websites with higher traffic?

dragby : On June 03, 2008 5:51 AM said:

Hi Arash,

As I understand it after watching the video, if a web site experiences heavy traffic, using Viewstate consumes bandwidth whearas using the session object consumes server memory. The alternative is to create a profile object in the web.config file which stores the information in a database, xml-file or wherever you designate.

If anyone gets an "Unable to connect to SQL Server Database" problem when referencing the profile object, then it could be because they did what I did. I deselected installing the "SQL Server Enterprise Edition (or whatever it's called) when installing Visual Web Developer. (I did so because I already had SQL Server installed on my machine.) I went to the download site and installed it. At first it didn't work, but later on (I guess after a restart of VWD) I no longer have this problem.

dragby : On June 03, 2008 7:39 AM said:

... actually I do still get an SQL error, but this seems to be due to a time out.

If i run the application a second time, so things load faster, then it works ok.

AdamBies : On June 17, 2008 9:29 AM said:

At 31:46 in the video, the Label does not populate with the value from the URL string when he runs the page application.  I sat here trying to figure it out myself having paused the video before I realized it did not work for the guy in the video either.

How come the guy just moves on to the next topic even though the code obviously didn't work when he ran the page without trying to fix it or explain why it didn't work for him either?

AdamBies : On June 17, 2008 9:53 AM said:

Nevermind.  I see that he re-traces the steps and see why it wasn't working.  Would have been nice to edit that one part out to avoid confusion LOL...  Great videos though overall.  I am learning a lot more from these than other resources online.

Bingobuddha : On June 17, 2008 4:35 PM said:

Got to say I am extremely happy with the videos and the fact this is a free application is a great bonus. I think the presenter of the vids is good for my style of learning and after running through only up to lesson 4 feel really comfortable with it all. V well done and thanks MS ( for a change lol ).

abelanet : On July 02, 2008 7:33 AM said:

Good lesson - I am enjoying all this series

Leave a Comment

You must be logged in to leave a comment. Click here to log in.

Featured Product

ComponentArt's New AJAX Approach