Solved

Object defining question(Need a Quick Answer!)

Posted on 2003-11-24
4
422 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

679 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