Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Setting a Session Variable within a Class


Message #1 by "Hugh McLaughlin" <hugh@k...> on Sun, 10 Mar 2002 00:29:34
Hello Everyone and thanks for your help in advance.  I am working on an 

application that requires the setting of a session variable.  I am trying 

to do this within a class but am running into problems.  Here is the code:



	Public Class PortalSecurity



		Public Function ValidateLogin(ByVal strLogin As String, 

ByVal strPassword As String) As Object

                        'Code to connect and query database

			myCommand.Fill(myDataSet, "RCNT")



			Return myDataset



Session("UserCount")=MyDataSet.Tables("RCNT").Rows(0).Item("RecordCount")



		End Function



	End Class



I encounter the error:

Compiler Error Message: BC30469: Reference to a non-shared member requires 

an object reference.



When I try to set the session value, but I am not sure exactly why.  Any 

help would be greatly appreciated.  Thanks.


  Return to Index