I am new to asp.net and have never used classic asp. My .net application uses ASP.net membership. I would like to attatch a forum written on classic asp using ASP.net membership credentials.
So, what I need to do, after reading a few articles, is write the asp membership credentials to a SQL DB in my ASP.net application and then retrieve them in classic ASP and put them into session variables which can then be used by the forum application.
I have done the 1st part but now need to retrieve the credentials from SQL using classic ASP. Please help. My code for putting the credentials into the DB is as follows:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Session("USER") = User.Identity.Name
Dim username As String = Session("USER")
Dim u As MembershipUser = Membership.GetUser(username, False)
Dim password As String
Dim emailad As String = Membership.GetUser("required_Username").Email
password = u.GetPassword()
Session("PASSWORD") = password
Session("EMAIL") = emailad
Dim accmd As New SqlCommand()
Dim cn As New SqlConnection
'SQL data conxn to db
cn.ConnectionString = ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString
' Run SQL Command
With accmd
.CommandText = "insert into Tempcred (username, password, email) values ('" & username & "' , '" & password & "', '" & emailad & "')"
.Connection = cn
.Connection.Open()
.ExecuteNonQuery()
.Connection.Close()
.Dispose()
End With
End Sub
Please could someone give me the code for getting the variable out of the DB in classic ASP.
Thanks in advance