Solved

Object defining question(Need a Quick Answer!)

Posted on 2003-11-24
4
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

734 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