I would like to set a connection string in a function with a Class.vb for an ASP.NEt Site.
However the 'request.cookies' command is not recognised in the class.
It appears to need something importing into the class ( I Hope ).
How can I find what this is? I believed it to be System.Web as shown below but Visual Studio doesn't like it.
Anybody any ideas?
Dazed and confused.
Remember.. 'Depression is just anger without enthusiasum'.
However the 'request.cookies' command is not recognised in the class.
It appears to need something importing into the class ( I Hope ).
How can I find what this is? I believed it to be System.Web as shown below but Visual Studio doesn't like it.
Anybody any ideas?
Code:
Imports Microsoft.VisualBasic
Imports System.Web
Public Class Class1
Public Shared Function GetConnectionFullString() As String
Dim strUserName As String
Dim strPassword As String
strUserName = Request.Cookies("UserName").Value
strPassword = Request.Cookies("Password").Value
Return ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString & "UserID=" & strUserName & ";password=" & strPassword & ";"
End Function
End Class
Dazed and confused.
Remember.. 'Depression is just anger without enthusiasum'.