Seesion Manager

G

Guest

Being new at web in general and starting in over my head
(http://www.vbdotnetheaven.com/Uploa...denVb11102005083632AM/SessionWebGardenVb.aspx),
I'm hoping to get some general direction on implementing an interface. In
the article above, there are public listings of two interfaces Session and
SessionManager.

Specifically I am receiving this error:

Error 1 Cannot refer to an instance member of a class from within a shared
method or shared member initializer without an explicit instance of the
class. C:\VB8\SQLPoorMon\SQLPoorMon\SQLPoorMon\Default.aspx.vb 41 12 SQLPoorMon

AND

a bunch of these:
Error 10 Class 'SessionManager' must implement 'Function createSessionId()
As String' for interface
'ISessionManager'. C:\VB8\SQLPoorMon\SQLPoorMon\SQLPoorMon\SessionManager.vb 18 16 SQLPoorMon


I am unsure of a method of dealing with an interface. For example, does the
declaration of the interface belong in the default.aspx or should it reside
in with the SessionManager class? How is the interface implemented? Is
there a call required from default.aspx similar to what might occur using a
WithEvents call? Does the interface need to be pre-registered in the GAC
before it can be implemented?

Help appreciated.
 
G

Guest

An interface "Looks like" a class, but it is only a contract and has no
implementation.
When you have a class that implements (derives from) an Interface, it must
implement all the
methods defined by the interface. The interface could be in a different
assembly, or even in the same assembly.
GAC is not involve here.

The error you referred to is that you have a static (shared in vb.net)
method where you are attempting
to refer to a non-static (instance) member of the class, and there isn't any
instance object to do it with.

Look up "Static" and "Shared" in the documentation.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top