Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get Connection String From DLL Class 1

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
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?

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'.
 
Try:
Code:
HttpContext.Current.Request("UserName").Value
HttpContext.Current.Request("Password").Value
 
Excellent. Thankyou.

Dazed and confused.

Remember.. 'Depression is just anger without enthusiasum'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top