I need to get the UserId to pass as a parameter to a stored procedure. I use VB.NET and none of the sample syntax I have found works. It always results in an Empty String.
I have tried:
Dim UserId As Object = DirectCast(Membership.GetUser(UserName.Text).ProviderUserKey, Guid)
and
Dim UserId as GIUD = New GUID(Membership.GetUser(UserName.Text).ProviderUserKey.ToString) Note that the "ProviderUserKey" is being returned (i.e., it is not an empty string!), so I don't know what's wrong with the cast itself. ...
Go to the complete details ...