473,499 Members | 1,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is the return type of Session("Something")?

This probably is a very noob question
What is the return type of Session("Something")?

I want to change:

If Not Session("Name") Is Nothing Then
LoginId = Session("Name").ToString
to something like

MyObject = Session("Name")
If Not MyObject Is Nothing Then
LoginId = MyObject.ToString

Dec 18 '06 #1
4 1562
Object
<ma*********@hotmail.comwrote in message
news:11**********************@t46g2000cwa.googlegr oups.com...
This probably is a very noob question
What is the return type of Session("Something")?

I want to change:

If Not Session("Name") Is Nothing Then
LoginId = Session("Name").ToString
to something like

MyObject = Session("Name")
If Not MyObject Is Nothing Then
LoginId = MyObject.ToString

Dec 18 '06 #2

Stephany Young schreef:
Object
Works, including the ToString call, which would be a polymorphic call
from a general reference I presume? Or is the Object type really a
Session Object type and not a general root for all Objects in VB, and
not like Object in Java?

Thanks a lot!

Dec 18 '06 #3
Every type is derived from type Object.

Object exposes a ToString() method therefore every type exposes a ToString()
method.

You can cast the returned object as type session:

Dim mySession As Session = CType(returnedObject, Session)
<ma*********@hotmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
>
Stephany Young schreef:
>Object

Works, including the ToString call, which would be a polymorphic call
from a general reference I presume? Or is the Object type really a
Session Object type and not a general root for all Objects in VB, and
not like Object in Java?

Thanks a lot!

Dec 18 '06 #4

Stephany Young schreef:
Every type is derived from type Object.
Hey, just to confirm, this is then a .NET property I think, not in VB
but in C# also, all objects are derived from type Object. Is that
correct?

As you might suggest, I am fairly new to .NET.

And thanks again, learned another little piece of .NET today.

Dec 18 '06 #5

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

Similar topics

8
2205
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP programming. I found something weird. Response.Write(Request("something")) It draws "None" when there's no value for something. Actually I expect "" instead of...
3
3977
by: gambler | last post by:
let's say you have: var games = new Array(); games = new GAME(gameNum, rotNum1, rotNum2, ... ); ( so a sparsley populate array which enables me to locate a game usin the game number...
5
1973
by: juglesh | last post by:
"$string = isset($xyz) ? $xyz : "something else";" Hello, someone gave code like this in another thread. I understand (by inference) what it does, but have not found any documentation on this...
10
2586
by: LaEisem | last post by:
On-the-job, I have "inherited" a lot of old C language software. A question or two about when "casting" of null pointer constants is needed has occurred during behind-the-scenes cleanup of some...
15
6699
by: Greenhorn | last post by:
Hi, when a function doesn't specify a return type ,value what value is returned. In the below programme, the function sample()is returning the value passed to 'k'. sample(int); main() { int...
5
3565
by: magix8 | last post by:
Hi, I have form GET method, example: index.asp?Type=1&Type=3&Type=4&.... So, I have something like this at the receiver side to retrieve multiple Type value and insert into tables.
7
1768
by: Brice Rebsamen | last post by:
Reading the code from showkey.c (from package kbd) I found this type of code: char *m; m = "RAW"; See below for the complete code. How can this work? I would have used strdup, or allocation...
3
2273
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi, I use Session to save and pass values between pages, (please see the following). It works fine on my computer, but on the server, I launch the main page, wait for 20 minutes, and click a...
0
7134
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,...
0
7225
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...
1
6901
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7392
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...
0
3105
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...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
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...

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.