Error with membership references RRS feed

  • Question

  • User-2087919080 posted

    The last line at Membership.GetUser.ProviderUserKey gives me an error message - 'Public Overridable ReadOnly Property ProviderUserKey As Object' is declared in project 'System.Web.ApplicationServices.dll', which is not referenced by project '5_Secure_Members.aspx'.  Add a reference to 'System.Web.ApplicationServices.dll' to your project '5_Secure_Members.aspx'.

    Can someone please offer guidance?

    Dim ConnectionString As String = ConfigurationManager.ConnectionStrings("LocalSqlServer").ConnectionString()
            Dim checkSql As String = "SELECT MembType FROM Subscriptions WHERE UserId = @UserId"
            Using myconnection As New SqlConnection(ConnectionString)
                Dim command As New SqlCommand(checkSql, myconnection)
                command.Parameters.AddWithValue("@UserId", Membership.GetUser.ProviderUserKey)

    Wednesday, January 28, 2015 10:14 PM


  • User-760709272 posted

    Add a reference to System.Web.ApplicationServices.dll just like the error is saying.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, January 29, 2015 4:09 AM