Membership Tables Empty After Create Users

Sep 2, 2010

I had to upgrade a sites ecuroty from a custom system to .net membership. I created all the users like this.

ds = Wservices.SelectBulkUsers()
If Not ds Is Nothing AndAlso Not ds.Tables(0) Is Nothing AndAlso ds.Tables(0).Rows.Count > 0 Then
For Each dr In ds.Tables(0).Rows
username = dr("username")
password = dr("password")
role = dr("SecurityClearance")
email = dr("email")
Dim newUser As MembershipUser = Membership.CreateUser(username, password, email, "", "", True, status)
Select Case role
Case "1"
Roles.AddUserToRole(username, "normal user")
Case "2"
Roles.AddUserToRole(username, "administrator")
Case "3"
Roles.AddUserToRole(username, "super administrator")
End Select
If newUser Is Nothing Then
errorMsg = username & " - " & status.ToString & "<br />"
End If
Next
litResult.Text = errorMsg
End If

I thought everything was fine and then went through the labourious task of replacing all the usersids used a as a foreign key in all the tables. It was only after doing this and trying to log on I couldnt, and noticed the membership table was empty. I assumed (stupidly) as it had done the users/ roles it must have done the membership. As I have already re-assigned the old user ids I dont want to import again as the userid will chnage. So my question is: Can I create a membership for each of the users in my aspnet_users table? I have the passwords etc in varchar fields at min from old table.

View 3 Replies


Similar Messages:

Security :: Insert Previous Users Into Membership Tables

Mar 10, 2011

I'm trying to do a bulk insert of data into the aspnet_Membership table. I have existing records from a previous version of the system I am re-building in asp.net. I've been researching and asking questions, but I am still missing something. What is the best way to do this? I believe I need to grab my previous table and iterate over each record and insert into the new membership table via the Membership.CreateUser method. So far I have been unable to make it work. My code so far in the on click event of a button is below.

using System.Web.Security;
using System.Data;
using System.Data.SqlClient; [code]....

View 7 Replies

C# - Migrate Users From Custom Table To Membership Tables?

Mar 9, 2011

I'm creating a new middle tier where all of our client calls will go through a WCF service. We're using ASP.NET membership with the service in order to authenticate users. The middle tier will be hitting an existing database in which we already have an InetUsers table containing usernames and passwords.This is where it starts to get messy. This new middle tier will be used by our web application, but not by our existing desktop application, which will - until we rewrite it at some point in the future - be using the old COM+ middle tier. Administration of the users for the web application takes place in the desktop application. In other words, users will be created and passwords set and changed from within the desktop application, which in turn hits the already existing InetUsers table.Ideally, what will happen is when we deploy the new middle tier, we'll take all of the users from the InetUsers table and create records for them in aspnet_Users and aspnet_Membership. Then we'll set a trigger on the InetUsers table to keep aspnet_Users and aspnet_Membership up-to-date.There's a whole bunch of questions wrapped up in this, so I'll try and list them all out here:Is this the right approach? Obviously having this data in two places isn't ideal, but bear in mind here that I'm not the final decision maker here and we're kinda stuck with some legacy stuff here, at least for now. Still - maybe there's a better way.In the same vein - would we be better off coding our own membership provider rather than using the SqlMembershipProvider? How difficult/easy is it to do so?If we use this approach, I plan on using the aspnet_Membership_XXXX stored procedures for the initial population of the tables as well as in the triggers. Having done some research into this, it appears that if I want to call aspnet_Membership_CreateUser directly from SQL (ie in a trigger...) rather than using the API, I have to store clear text passwords since I can't get the salt and the hash right otherwise. Is this true?Does any of this even make sense or am I going about this the wrong way to begin with?

View 2 Replies

How To Create Default Users In Web.config For Membership

Sep 6, 2010

how can I add default users in my web.config to test my asp: login control

View 1 Replies

Membership - Can Create A Website With Users Without Using MembershipProvider

Feb 20, 2010

Is it possible to have an ASP.NET website which allows users to register and login, without using a MembershipProvider?

And instead just work directly towards custom database tables which stores user information?

View 3 Replies

How To Create Users In A Membership Table Without Using CreateUser

Jun 2, 2010

I want to migrate users and posts from an existing forum I am using to a ASP.NET membership table without using CreateUser. Basically I want to maintain userIDs so that when I migrate posts they continue to associate with the correct users. Is there a way to do this or would I be better off just using CreateUser and then finding a way to re-assign the post-by-UserIDs to the correct new IDs?

View 3 Replies

Membership Create Users, Logging In Works. But Then It Doesn't?

Feb 14, 2011

I have a application that connects to a remote sql server. I am able to create users and they are stored in the DB. Then I can go to the login page and login. But after a while, I am unable to log in and it just sits at the login page. The user is still in the DB

<configuration>
<connectionStrings>
<add name="LoginSQL" providerName="System.Data.SqlClient"

[code]...

View 1 Replies

Security :: Using Custom Membershipuser To Create Users In The AD With Membership?

Jul 28, 2010

I'm have a doubt using membershipuser to create users in the AD with Membership.CreateUser Method, does any one knows how can i send other attibutes to the AD, such as First Name and Last Name?, besides those ones: username

As String, _

password As String, _

email As String, _

passwordQuestion As String, _

passwordAnswer As String,

View 3 Replies

C# - Administer Website (create New Users, Assign Users To Roles, Etc.) From A Windows App?

Feb 9, 2010

I have an asp.net web app that uses forms-based authentication, a SqlMembershipProvider (using an encrypted password format), and a SqlRoleProvider. I need to know if it's possible to administer the users (create new users, assign them to roles, etc.) from a windows application - the powers that be don't want any administrative functionality in the web app itself.

Here is the membership provider definition from web.config:

[code]....

So, obviously, I have a Sql Server database that contains the users and roles for the web app. I'd like to create a separate windows app that references the web app assembly, and use the configured MembershipProvider, RoleProvider, and machineKey to create users, assign users to roles, etc. If that's not possible, I can duplicate the configuration settings from web.config within the windows app. But I don't know how to do this either.

View 3 Replies

Security :: After Successful Creation Of 3 Users On My Web Site Now Cannot Create Users

Dec 6, 2010

[Code]....

after successful creation of 3 users on my web site now cannot create users

View 9 Replies

How To Add Membership Tables To Existing Database

Oct 5, 2010

I was reading through this post here http://www.misfitgeek.com/op-ed/adding-asp-net-membership-to-your-own-database and thought to my self what the common practice is. What do developers using ASP.NET membership and authorization in their applications recommend as a best practice? creating the membership tables in the same database that stores their applications data or configuring a second database to store ONLY the membership information?.

My current setup is a different database for membership information ONLY but am thinking that increases the number of databases i have to maintain. If I have 5 applications using asp.net membership, then that means 5 more asp.net membership databases. So do you normally create the asp.net membership tables in your main database or you configure a separate membership table? what do you recommend.

View 1 Replies

C# - 4 Custom Membership Provider Tables

Apr 3, 2011

Now this might just be straightforward, but I can't seem to figure it out..

I have set up the Custom Membership provider, and gave it the proper connection stuff.
What I know is that it connects to the correct database, but I know for sure that it doesn't look at the correct table.

How would I set it up to use a specific table? As the table already has users in them.

The table name is: members_info.

the column names are: member___id(key), member_name, member__pwd, member_perm

member___id => Being the Key and the account name to login with
member_name => Being the users Name or Nickname
member__pwd => 10 chars long (for now)
member_perm => holds 1 of the following values: 0) User 1)Admin 2)Banned


now I know that the later one is to be setup by the Role Provider, and I'm sure once I know how to do the membership one that one is similar in some way.

So my question is, how do I point the Custom Membership Provider to the table: members_info and to use member___id for username, members__pwd for password (and possibly get member_name out to say: Welcome {member_name}! when they login).

===

Added info.
Members__uid is the key value as it increases on each new entry.

===

Since you can't tell it to use a specific table

How can I set it up so, that it works with the tool provided in visual studio? (Website > ASP.net Configuration).

As it now says 0 users, on the security tab. I want to be able to manage the users through here too.

View 1 Replies

SQL Server :: ASPNET Membership Tables?

Oct 22, 2010

How can I sync up the aspnet membership tables among 2 different databases?

View 1 Replies

Security :: Membership Connection With The Tables?

Apr 10, 2010

i have Login membership, also have table with database address, with columns: UserId, Address, City, etc... How given the user login,show data after the user login with another database table address (UserId) .

View 19 Replies

Security :: Merging Membership Tables With Database?

Mar 7, 2010

I am using aspnet_regsql.exe to add membership tables to my database.

when I click the exe file it just opens up an XML file in visual web developer and does not start the wizard to merge the databases.

the run command where file is located is below

C:WINDOWSMicrosoft.NETFrameworkv2.0.50727

I just get the file below opening instead

[Code]...

View 1 Replies

Security :: Getting Membership And Roles Tables Created In A Different Db?

Jul 29, 2010

Lets say that I have a database set up with a load of info in it and I decide I want to add the membership and roles functionality to my site but my hosting provider makes me pay for each database I use. I don't want to pay for another db, so how do I set it up so that instread of creating membership and roles tables in the the aspnetdb database, it creates them in my existing database?

View 5 Replies

Sql Server - How To Customize The Membership Database Tables

Jun 21, 2010

I want to add custom columns to some tables created by ASP.NET. For example; I need to add two fields such as FirstName and LastName to the aspnet_Membership table.

I can add this directly by editing the table but;

Is this the right thing to do (I mean; extending the table directly) OR should I create a separate table and hold the extra user data, there?How can I see these custom database fields as properties in code completion? example: membershipuser.FirstName;

View 4 Replies

Security :: Change Membership Tables And Its Column Name?

Mar 26, 2010

I want to rename aspnet_application table and its columns. 1- Does membership framework allow me to do that ?2- Will there be any problem in accessing System.Web.Security functions ?3- I have to change procedures and functions etc ?

View 1 Replies

Security :: Default Membership Tables For Oracle?

Sep 6, 2010

Is there a way to create the required Membership tables/SPs for Oracle? Just what aspnet_regsql does. Something like aspnet_regORACLE :).

View 4 Replies

Security :: After Adding New User With Membership.CreateUser Aspnet_membership Is Empty?

Aug 12, 2010

I have a problem with my membership management. I moved the aspnet membership database to my MSSQL server and I would like to create an add user form not using the CreateUserWizard (I would like to add more information then in the simple CUW). I've created the form and I would like to use the Membership.CreateUser method to add the user. After running the script (VB) the user is available in the aspnet_Users table, also in the aspnet_UserInRoles table but not in the aspnet_Membership table. I'm sure that something is wrong with the configuration, I just can't find what.

[Code]....

View 5 Replies

C# - Creating And Executing A Script For The Default Membership Tables?

Feb 5, 2011

I'm creating an AppHarbor MVC3 application and want to use the standard membership provider support. The AppHarbor guys told me I needed to create script for the table structure that I can run on my AppHarbor database. I'm not really familiar with databases, however. How do I go about creating and executing a script for the default membership tables?

View 1 Replies

MVC :: Check Boxes Not Updating Membership Or Roles Tables?

Feb 8, 2010

I've got an MVC 1.0 View that is more-or-less an attempt at reproducing WSAT.

On the Security->Manage Users page there's a column of checkboxes for "Active" for each user. Also when clicking the 'Edit roles' link a set of roles shows up in the Roles column of the table.

I'm using the standard SQL based Membership and Role providers that come out of the ASP.NET box.

For some reason, when I run the app from VS2008 all is well and I can update the Active and Roles values. However, when I deploy to a remote server, either my test server or in production, the checkboxes don't update the databse. Note that the links for 'Edit user', 'Delete user' work fine. I can create a new user or delete a user with no problems in any of the deployed locations. Also the 'Edit roles' link also works fine in that it brings up the list of all possible roles and shows which roles the user is in. The problem is specifically with the Checkboxes.

Interesting to note is that the JavaScript alert() (see below) does fire when clicking on any of the Role checkboxes. However, although the box is checked, the database is not updated on the any but VS2008 Casini. The database connection string is not changed on any of the execution sites which are running SQL 2008. IIS 7 on one deployed server (an ISP) and 7.5 on the other my in-house test server.

Here's the code I'm using to create the Roles portion of the page:

[Code]....

View 3 Replies

Use Existing Sql Server Tables Along With Role And Membership Provider?

Mar 30, 2011

I have an application in Asp.net and using sql server to store user information. There is a table named dbo.member which stores user information - fname, lastname, email, phone etc. We use LDAP for authentication. The entire application works on this member table. There is a unique userid(not password) associated with each member. I installed default aspnet_membership, aspnet_role tables by running aspnet_regsql.exe utility. Now with increasing number of applications, handling members' information is becoming nightmare. I hope Membership providers will solve this problem but I have doubts.

How can I integrate existing member table with default aspnet_membership table? Or should I integrate since it is very limited? Same is the case with aspnet_Profile - it is very limited and I have stored all profile information into member table. We store more information and we want to query all that information for a user. Should I create my own provider that will use dbo.Member table instead of dbo.Membership table and also with Profile provider?

View 1 Replies

Security :: Adding Membership Tables To Existing Database?

Feb 22, 2011

I am running windows 7 and NET Framework 4.

Problem is I dont know how to locate the asp.reg.sql tool that will do this using windows 7.

how to do this?

View 1 Replies

Configuration :: Deploying Website With Membership And Misc Tables?

Aug 10, 2010

I'm about to roll out my web site soon, and was just wondering if there's a way to roll out the db I'm working with on my dev computer, or if I have to recreate everything on the production server. If I can roll out my dev db, will the uids be the same?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved