Solved

Object defining question(Need a Quick Answer!)

Posted on 2003-11-24
4
416 Views
Last Modified: 2006-11-17
code:

Dim EnteredID As String, EnteredPW As String
Dim Session As New Object

        Session("Employee_ID") = txtName.Text
        Session("Employee_Password") = txtPassword.Text
        EnteredID = Trim(txtName.Text)
        EnteredPW = Trim(txtPassword.Text)


I keep getting this error message:

No default member found for type 'Object'

What am I missing?  I just need a quick answer............Thanks!
0
Comment
Question by:KMTran33
4 Comments
 
LVL 4

Accepted Solution

by:
krznpsk earned 500 total points
ID: 9814817
Is this an ASP.NET application?  If so, then you should remove the line "Dim Session as New Object," because Session is an object that's constantly in scope.

Object is not a type that you can index into, however, the "Session" object is.
0
 
LVL 9

Expert Comment

by:malharone
ID: 9814839
to store info in session, you don't need to create a new session object. it already has been created to you.

Dim EnteredID As String, EnteredPW As String  <---- just for the sake of clarity, separate in 2 lines
Dim Session As New Object    <---- Object is NON instantiable class ... e.g. you can't really create a new OBJECT.

        Session("Employee_ID") = txtName.Text
        Session("Employee_Password") = txtPassword.Text
        EnteredID = Trim(txtName.Text)
        EnteredPW = Trim(txtPassword.Text)


CORRECTED/SUGGESTED
-------------------------------------

Dim EnteredID As String
Dim EnteredPW As String

'Storage
Session("Employee_ID") = txtName.Text
Session("Employee_Password") = txtPassword.Text
EnteredID = Trim(txtName.Text)
EnteredPW = Trim(txtPassword.Text)

'--------------

'retrieval ...

response.write(session("Employee_ID"))
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10277179
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: krznpsk {http:#9814817}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now