A
antonyliu2002
For my web application, I store a primitive array of strings to
session.
Dim arrLastNames(10) As String
blah blah
Session("AllLastNames") = arrLastNames
Now, when I retrieve this session item with the session key
"AllLastNames", how do I cast it back to an array of primitive Strings?
I tried below, but did not work:
Dim arrLNames(10) As String
arrLNames = CType(Session.Contents("AllLastNames"), String())
The compiler says,
System.InvalidCastException: Specified cast is not valid.
Thanks.
session.
Dim arrLastNames(10) As String
blah blah
Session("AllLastNames") = arrLastNames
Now, when I retrieve this session item with the session key
"AllLastNames", how do I cast it back to an array of primitive Strings?
I tried below, but did not work:
Dim arrLNames(10) As String
arrLNames = CType(Session.Contents("AllLastNames"), String())
The compiler says,
System.InvalidCastException: Specified cast is not valid.
Thanks.