.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

SQL Membership

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :C#

We have following problem.

we have intranet site using AD users, and extended web apication so that same site can use Extranet users using SQLMembership provider.
Now we have custom wss page on witch user on intranet site creates user for extranet.

Problem is that we use Membership.CreateUser method but no user is created in database.
In web.config for both site Membership provider is configured to same database.



View Complete Post

More Related Resource Links

Multiple membership providers



In my web.config I have:

        <add name="ADProvider1"
        <add name="ADProvider2"

If I just have ADProvider1 it works, when I add ADProvider2, even though for testing I only use ADProvider1 I get an error: "Unable to establish secure connection with the server"

Am I adding the second provider to the membership section incorrectly?



Replacement options for Membership


Hi everyone,
     I tried to use Microsoft's Membership option for signing up new users and authenticating them on subsequent pages, but it has not worked very well. The biggest issue has been with the REMEMBER ME function. With this checked, I am randomly logged out in the middle of some functions and some pages always show me as not authenticated, while others properly show me as authenticated. I built a site based on VB.
I was wondering what other people are using ro register users and monitor authentication and also if anyone has had better experiences with other solutions. 

Hi everyone,

     I tried to use Microsoft's Membership option for signing up new users and authenticating them on subsequent pages, but it has not worked very well. The biggest issue has been with the REMEMBER ME function. With this checked, I am randomly logged out in the middle of some functions and some pages always show me as not authenti

Pass ASP.NET membership identity object across domain?


I am trying to figure a way to SSO with ASP.NET membership and role model.

I can implement custom membership provider which consume web services hosting on a server.

With encryption of data. No problem.

But my question is, If I sign on a website with my provider, got my identity object on that application,

could I pass it to another website on another domain which use the same provider and by doing so, do not need to login again?

If this is possible, I am going to implement this solution. Please tell me what's your take on this.

Membership Search user


Is there a membership function to search a username Like this:   LIKE '%UserName%' ?

This is not working.

MembershipUser User = Membership.GetUser("%" + TextBox1.Text + "%");

Thank you.

Membership Provider Conn String


Hello. I've bee successfully using the Asp.Net Membership Provider in my VB.Net 3.5/SQL 2005 web app for a year now (Site A). However, I've added 2 new sites (B and C) (both with their own DB) and now I see a problem. It looks like users that get created for sites B and C also get created in site A. Roles that I create for B and C only get created in A. I think it is a conn string problem.

When I created A, I adde the conn string to my machine.config (not sure why I did this or if it is even needed)...


         <add name="LocalSqlServer" connectionString="Data Source=VS689\SQLEXPRESS;Initial Catalog=SiteA;USER ID=sa;PASSWORD=123456"/>


                <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=blahblah" connectionStringName="LocalSqlS

Use Membership but bypass / disable password usage for users


I have an application that does LDAP authentication. The authentication is done on the code behind page of my Login.aspx page. Once the user passes LDAP authentication, a cookie is set and I redirect:

FormsAuthentication.RedirectFromLoginPage(UserName.Text, False)

I would like to setup membership in my application and keep track of some user information. But due to company security requirements, I cannot store user passwords on my application. That must stay on the LDAP server only.

Is there a way to store users but disable password storage on the aspnet_membership table?

Membership provider for MS Access in VB


Hi all,

Over the past few weeks I've been attempting to convert the readily available C# code for the Membership Provider etc whilst working with MS Access. I'm fairly experienced with VB unlike C# and have ran AccessMembershipProvider.cs, AccessConnectionHelper.cs and so on through 3 different converters. All of which have given a varying degree of errors, all of which I've fixed, either by ever so slightly re-writing the logic or in the Cryptographic case finding a working translation.

This evening I have fixed all of the errors from all of the now converted VB files (which I was pretty pleased about as you can imagine), I then created a simple login page to test this out, added a new user to the system and tried to login to find out I'm being told the username or password is wrong.

Just to clarify, the converters all had an error or two or even more in some cases which I've bypassed but now I can't login - at all!!

Any initial suggestions?

Finally I've written reams of code over the years and am really stumped on this one, has knowone actually successfully converted these files from C# to VB and actually got it working?? I'm not looking for someone to send me there hard work but I am almost at the point of not wanting to bother with it anymore and I just can't believe that it's not out there to download

Who Goes There?: Upgrade Your Site's Authentication with the New ASP.NET 2.0 Membership API


Here Dino Esposito and Andrea Saltarello cover the plumbing of the Membership API and its inherently extensible nature, based on pluggable providers. To demonstrate the features, they take an existing ASP.NET 1.x authentication mechanism and port it to ASP.NET 2.0, exposing the legacy authentication mechanism through the new Membership API.

Dino Esposito and Andrea Saltarello

MSDN Magazine November 2005

How do I prevent displaying membership of an AD group in Colleague Tracker web part?


I'm a big fan of the Colleague Tracker web part in MOSS 2007 My Sites, especially the option to show 'Membership Changes'. This is often useful in highlighting that a colleague has been added to a certain AD group.

We now want to hide the membership of certain AD groups from the colleague tracker. For example, if an AD group called 'Project X' is created, we don't want membership of the group broadcast throughout the My Sites where colleagues are tracking colleagues.

My first thought was that we could use AD to 'deny read' on the 'Project X' AD group to all SharePoint related service accounts. This does not appear to have worked, although perhaps the configuration is more complex? The best approach would seem to be to prevent the group membership data ever being imported from AD to the SSP, hence my 'deny read' approach.

Has anyone successfully implemented this, or does anyone have any better ideas?


Extending Role/Membership


Given an organization site, here is what we need to accomplish:

  1. Administer Role/Membership completely on specific pages of the remotely hosted site instead of using a local site within Visual Studio.
  2. Create and add region group, city group or other groups in addition to the basic user group. How can the new groups be stored and administered?
  3. After users login the 1st time, their Role/Membership are saved so that they will be redirected to their own designated page upon future login. Are we going to use cookies and/or tables to store related data?

Please advise how to best implement the above with samples and/or tutorials.

Thanks much in advance.

Disable links based on membership



I've somehow managed to successfully get Membership working on a test site I'm playing with (learning!). I've reached a point where I can redirect users to another page if they do not have the required level of membership - using the allow feature in a web.config within a folder.

What I would like to do now is create a main menu of links (a back office menu visible after the use has logged in), and disable a link if they do not have access to view that page. Is this complex? I'd be grateful for any sample code to get me started.

Many thanks

Implementing a custom Membership Provider vs. using aspnet_Profile table - Which should I do?


I wanted to expand the amount of information that is associated with each user(MembershipUser) in the ASPNETDB.MDF database file. Adding columns like FirstName, LastName, etc. So I began implementing my own custom Membership Provider. I created a derived MembershipUser class with the extra private variables that I wanted each MembershipUser record to store. Its basically done. Almost after I did this I stumbled across the columns in the ASPNETDB.MDF->aspnet_Profile table called "PropertyNames" and "PropertyValuesString".  Could I have simply used these two columns to accomplish what I was attempting to do or are these columns for global application configuration settings?  

Is the aspnet_Profile table purpose to store expanded/related information about users such as personal information? Or is it for something else? Thanks.

FileUpload Control with membership and roles


Hi Everyone!

I'm pretty new to development using Microsoft technologies.

I'm trying to build a portal kind of an application in asp.net, in which one of the functionality is letting people log in and upload their documents. The upload page is only accessible to registered users of the portal.


I would like to track the user uploaded files according to their userIds.

Is it possible to use the FileUpload Control and C# to fetch the current user id, create a directory with the same name(as that of userID) in the file system and upload the files( multiple file upload, if necessary) into it?

Also another admin page would have to be able to see the list of files uploaded by the specific user and download it if necessary.

Could anyone help me with this?

I'm also expecting alternate solutions to the problem.

Awaiting a response.

Thanks in advance 


Membership.ValidateUser "The serviceUri configuration setting was not found."


Hello everybody!

I use Membership.ValidateUser to check user credentials, but when I do so, I get the following ArgumentException: "The serviceUri configuration setting was not found." I just can't understand what is the problem here.

Here is a part from my Web.config:

      <membership defaultProvider="MembershipProvider">
            description="ASP.NET Membership database services."


Adding additional fields to my custom membership provider

Hi, i have been playing around with the membership provider model for the last week and have it got it working with a basic table schema.  The trouble i have is that i wish to add an additional field (eg First Name) but am not sure how i can do this.  Here's what i have so far: public override MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status)    {        MembershipUser user = new MembershipUser(Name, username, providerUserKey, email, passwordQuestion, null, isApproved, false, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now);        string sql = "INSERT INTO USERS(USERNAME,PASSWORD,EMAIL,ISACTIVE) VALUES(@UID,@PWD,@EMAIL,@ISACTIVE)";        db.AddParameter("@UID", username);        db.AddParameter("@PWD", password);        db.AddParameter("@EMAIL", email);        db.AddParameter("@ISACTIVE", (isApproved == true ? "Y" : "N"));        int i = db.ExecuteNonQuery(sql); 

Multiple groups of roles in membership

Hi,I am developing this website which requires multiple groups of roles inside membership.Here is an example:I want to create a group of states (would be the first group of roles):* Oregon* California* Kansas* Texas* OhioAnd then a second group of profiles:* Admin* Section 1* Section 2* Section 3Then I want to comine these groups, so for example:* Patrick has Oregon and Section 1 role, so he can only access the state of Oregon and Section 1 module on the website.* Laura has Kansas and Section 2 role, so she can only access the state of Kansas and Section 2 module on the website.* John has Ohio, Texas and Admin and Section 1 roles, so he can only....Do you understand what I mean? How can I achieve this with .net memberhip?

Moving Membership tables to production; empty

Hi all: I'm currently moving my application from my testing environment, onto our live environment.  I've moved my database, including all membership tables over, and everyting is empty.  Again, this is what I wanted.  The test environment had far too much "crap" data, including fake user, so I wanted to just start from scratch on the production environment.  I don't know how to re-create the application or the first user though in these membership tables??  I'm sure this isn't an odd thing to do, but I havent' had any luck yet with finding an answer of how to do this.  Any help is greatly appreciated! Thanks, Terri-Lynn 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend