Posted on: 5/3/2014 10:11:05 AM | Views : 407

Hello
I use the following code to get the current user
Protected Sub LoginUser_LoggedIn(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginUser.LoggedIn Dim currentUser As MembershipUser = Membership.GetUser(User.Identity.Name) Dim username As String = currentUser.UserName Dim userID As Guid = currentUser.ProviderUserKey ''''''''''''''''''''''''''''''''''''''''''''''''''''' Dim sql As String = "SELECT CustomerID,CustomerName FROM Customer WHERE UserID = " + userID.ToString Dim myConnection As SqlConnection = New SqlConnection("Data Source=mssql501.ixwebhosting.com;Initial Catalog=C209256_library;User ID=C209256_library; Password=A123456789") Dim myCommand As SqlCommand = New SqlCommand(sql, myConnection) myConnection.Open() Dim myReader As SqlDataReader = myCommand.ExecuteReader() If myReader.Read() The ...

Go to the complete details ...