Re: Storing a datatable (or arraylist )on ASP.NET Session

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello basulasz,

That code works fine. Have you tried to run that in new project.
Perhaps your ArrayList store smth which can't be casted to object. If exactly that code u shown didn't work (emply arraylists) that I recomment to re-register asp.net 2.0 calling aspnet_regiis,exe - i

---
WBR, Michael Nemtsev [.NET/C# MVP]. My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we miss it, but that it is too low and we reach it" (c) Michelangelo

b> Hi Michael;
b> b> There is noting interesting in the code, just creating arraylists and
b> defining values like below
b> b> ArrayList al_RecNo = new ArrayList();
b> ArrayList al_Mess = new ArrayList();
b> ArrayList al_Type = new ArrayList();
b> Session["_al_RecNo"] = (object)al_RecNo;
b> Session["_al_Mess"] = (object)al_Mess;
b> Session["_al_Type"] = (object)al_Type;
b> In this case does session state make any sense? For example on my
b> project there is no definition in web.config file about SessionState.
b> But on web server the SessionState is configured as InProc and
b> session variables is stored on web server's local sql database. What
b> should I do in this case? Should I configure my project to store
b> variables on local sql server? Is it not possible to store arraylist
b> or datatable object on session without storing variables on sql
b> server?
b> b> Thanks...
b> b> "Michael Nemtsev" wrote:
b>
Hello basulasz,

could you demonstrate your code?

Seems that you are using the outproc session state, where your object
in session must be serializable

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/
"The greatest danger for most of us is not that our aim is too high
and we miss it, but that it is too low and we reach it" (c)
Michelangelo

b> Hi;
b>
b> I want to store a datatable (or an arraylist) as a session
variable
b> but when I try;
b>
b> Session["_al_RecNo"] = al_RecNo;
b>
b> I get an error that;
b>
b> "Cannot implicitly convert type 'System.Collections.ArrayList' to
b> 'string'"
b>
b> But I now that we can store objects in session. I have done this
b> before on VS.NET 2003. What is wrong with that? Is there an option
b> that we can activate? How can I store an arraylist or a datatable
as
b> a session variable?
b>
b> Thanks a lot
b>


.



Relevant Pages

  • Re: Storing a datatable (or arraylist )on ASP.NET Session
    ... There is noting interesting in the code, just creating arraylists and ... In this case does session state make any sense? ... server the SessionState is configured as InProc and session variables is ... Should I configure my project to store variables on local sql server? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Storing a datatable (or arraylist )on ASP.NET Session
    ... Seems that you are using the outproc session state, where your object in session must be serializable ... WBR, Michael Nemtsev [.NET/C# MVP]. ... Team blog: http://devkids.blogspot.com/ ... b> But I now that we can store objects in session. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: LISP for web
    ... >>Ideas on how to store this information centrally for all of the app ... > ucw's form handling code (to make sure session ids are always ... > can deal with hardware failures an the app servers but this ...
    (comp.lang.lisp)
  • Re: Problem with asp.net app only allowing 1 user at a time
    ... from the client to the server), Application (an object that can store ... Now in your case you are reading and writing everything to the database, ... there is the Session object. ... To retrieve this you would do something like: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: LISP for web
    ... > Ideas on how to store this information centrally for all of the app ... the risk of losing data and sessions if one of the machines goes ... ucw's form handling code (to make sure session ids are always ...
    (comp.lang.lisp)