Wednesday, February 27, 2013

System.NotImplementedException: The method or operation is not implemented. at Microsoft.SharePoint.Administration.Claims.SPClaimsAuthMembershipProvider.GetUser(String name, Boolean userIsOnline) + SharePoint 2010 FBA


I am getting error because of below line

//MembershipUser currentuser = obj.GetUser(username, false);


Provide your authentication provider name as shown below


                    MembershipUser currentUser = Membership.Providers["RSCMemberProvider"].GetUser(username, false);
           
                    Guid newUserId = (Guid)currentUser.ProviderUserKey;

                    //string updateUserSql = "UPDATE aspnet_Users SET " + field + " = '" + value + "' WHERE UserId= '" + key + "'";
                    string FirstName = ((TextBox)(RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("txtFirstName"))).Text.Trim();
                    string LastName = ((TextBox)(RegisterUser.CreateUserStep.ContentTemplateContainer.FindControl("txtLastName"))).Text.Trim();

                   string updateUserSql = "UPDATE aspnet_Users SET FirstName='" + FirstName +"', lastname='" + LastName + "' WHERE UserId='" + newUserId + "'";

                   Response.Write(updateUserSql);

                   using (SqlConnection dbConnection = new SqlConnection(connectionString))
                    {
                        dbConnection.Open();
                        SqlCommand comd = new SqlCommand(updateUserSql, dbConnection);
                        comd.ExecuteNonQuery();
                        dbConnection.Close();
                    }

Followers