Search Results

Search found 2 results on 1 pages for 'user512602'.

Page 1/1 | 1 

  • In Winform I need ASP.NET like membership and roles stuff. But Roles doesn't work

    - by user512602
    Hi, following http://www.theproblemsolver.nl/usingthemembershipproviderinwinforms.htm I set up the membership & roles providers in app.config and try use it in code. Authentication works well, bur roles always returns empty roles array for connected user. This part works: If Membership.ValidateUser(userName, password) Then ' Set the current application principal information to a known user Dim identity As GenericIdentity Dim principal As RolePrincipal Dim user As MembershipUser user = Membership.GetUser(userName) identity = New GenericIdentity(user.UserName) principal = New RolePrincipal(identity) Threading.Thread.CurrentPrincipal = principal This one doesn't: If principal.IsInRole("Club") Then LoggedInUserRole = "Club" Return True Exit Function End If No error is thrown though. Similarly, if I try to add a user to a known, existing role, an exception is thrown : If Not Roles.IsUserInRole(userName, "club") Then Roles.AddUserToRole(userName, "club") End If Exception msg is: Cannot find role '' (I mean the role name isn't given back in exception.) Any clue? Please do not tell me to use Windows Client Administration within project services, I need my own SQL DB connection + the client app services is a bloated dfeature, bug prone.

    Read the article

  • Wrong SQLServer syntax: need help!

    - by user512602
    Hi, this is what I want to achieve: 4 tables are involved: Players with PlayerID as PK, Competitions with CompetID as PK Results with ResultID as PK and CompetID as FK And the 4th table: PlayerResultts with ResultID + PlayerID as PK and CompetID as new column I created. Competitions, results and PlayerResults are already populated and quite large (300000 PlayerResults so far). In order to populate the PlayerResults.CompetID column, I try a Update ... (Select....) request but I'm not aware of the right syntax and it fails. Here is my feeble attempt: update PlayerResults set competid = (select distinct(r.competid) from results r, playerresults p where r.resultID = p.resultid) Error is (of course): "Msg 512, Level 16, State 1, Line 1 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , , = or when the subquery is used as an expression." Can someone put me in the right direction? TIA

    Read the article

1