473,624 Members | 2,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP.NET Sesssion State, SQL Server, Objects, Invalid Cast

Hi,

We are currently running an asp.net application where we are using sql
server to store session state. There are a couple of areas where we store
the state in a class that we then add to the session object. The classes in
question use the [Serializable] attribute. This seemed to work well, we can
put a bit of state into the session object, then cast it back into a class
and use it when needed.

Last week we had a user who was getting an "System.Invalid CastException:
Specified cast is not valid." error. This has only happened with one user so
far, and was intermittent.

Has anyone had similar problems? What sort of things on the client would
affect the way IIS is able to store state?

Environment
Operating System: Windows 2003
Web Server:IIS 6.0
Application:.NE T Framework 1.1
Language: C#
Web Browser: Internet Explorer 6.0

Thanks,

Mike

Nov 19 '05 #1
1 1153
since session information isn't guaranteed to be there, are you testing for
null when you pull out of session?

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc
"Mike" <Mi**@discussio ns.microsoft.co m> wrote in message
news:A2******** *************** ***********@mic rosoft.com...
Hi,

We are currently running an asp.net application where we are using sql
server to store session state. There are a couple of areas where we store
the state in a class that we then add to the session object. The classes
in
question use the [Serializable] attribute. This seemed to work well, we
can
put a bit of state into the session object, then cast it back into a class
and use it when needed.

Last week we had a user who was getting an "System.Invalid CastException:
Specified cast is not valid." error. This has only happened with one user
so
far, and was intermittent.

Has anyone had similar problems? What sort of things on the client would
affect the way IIS is able to store state?

Environment
Operating System: Windows 2003
Web Server:IIS 6.0
Application:.NE T Framework 1.1
Language: C#
Web Browser: Internet Explorer 6.0

Thanks,

Mike

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
31021
by: Krung Saengpole | last post by:
Hi, I used SQL Server 2000 Personal Edition. I created a stored procedure having input parameters as smallint,tinyint,char,varchar and smalldatetime. When I executed it by Query Analyzer, it's ok. But when I executed it by ASP code that used ADODB.command, it showed error: Invalid character value for cast specification . Though SQL Server debugger, it showed: Invalid character value for cast
5
3537
by: Frank | last post by:
Our system maintains session state using the ASP.NET State Server service. We expect some of our session state objects to be over 85K, which categorizes them to be VLO's (very large objects) in terms of .NET memory allocations. This means that these objects will be allocated in a special managed heap for large objects. This makes sense since this would require some work for the garbage collector to move and compact these objects during a GC...
2
783
by: Brad | last post by:
I have an intranet app that has just started sporadically getting the following error "The viewstate is invalid for this page and might be corrupted." By sproadic I mean 3-4 times during the past two days out of 100's of hits. The error just started yesterday and this app has been running for quite some time without this error and has not been updated just before or after the error started. Reseaching this error I've checked the...
3
2274
by: John Howard | last post by:
Making the following call to a local MSAccess database works fine: Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs) Dim intRows As Integer Dim strSQL As String Dim ds As New DataSet ' Create connection Dim cn As New OleDbConnection With cn .connectionstring =
2
2170
by: John A Grandy | last post by:
for high traffic public websites , what are the proven options for session-state storage & management ? is an out-of-process state-server generally preferred over a sql-server ? what are the relevant criteria ? is the primary criteria max expected total storage size (for all active sessions) versus max ram available on the state-server machine ? if ADO.NET objects (such as small DataTables) must be stored in session-state , is any...
1
1369
by: John Grandy | last post by:
Could someone point me in the direction of good discussions on scalable state management solutions? Specifically, pros and cons of following strategies: Strategy 1 : temporary business-objects are implicitly stored in RAM, "permanent" business objects are explicitly stored in SQL-Server Strategy 2 : both temporary and permanent business-objects are implicitly stored in SQL-Server
6
3782
by: Daniel Walzenbach | last post by:
Hi, I have a web application which sometimes throws an “out of memory” exception. To get an idea what happens I traced some values using performance monitor and got the following values (for one day): \\FFDS24\ASP.NET Applications(_LM_W3SVC_1_Root_ATV2004)\Errors During Execution: 7 \\FFDS24\ASP.NET Apps v1.1.4322(_LM_W3SVC_1_Root_ATV2004)\Compilations
4
4379
by: Shawnk | last post by:
This post is intended to verify that true value semantics DO NOT EXIST for the Enum class (relative to boolean operations). If this is true then (thus and therefore) you can not design state machines in C# where the machine can use the enumerated 'state' to execute (thus the term 'machine' as in 'state machine') the machine operations as this requires boolean operations to be performed on the state. .....
0
2212
by: =?Utf-8?B?SkhhbGV5?= | last post by:
Our system is: IIS Server: dual Intel Xeon 2.80 GHz, 4 GB Ram Windows Server 2003 SP2 IIS 6.0 SQL Server: dual Intel Xeon 2.80 GHz, 4 GB Ram (separate server) Windows Server 2003 SP2 SQL Server 2000 We are having some problems with a website we are developing, and had some
0
8233
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8474
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.