473,657 Members | 2,765 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Membership - Getting User Id after CreateUser

Hi,

I like to grab the user id of the currently added user. However, I
can't find a property that would do it.

MembershipUser newUser = Membership.Crea teUser(tbxUsern ame.Text,
tbxPassword.Tex t,

tbxEmail.Text, "empty",
"empty",
true, out status);

I need something that would give me the newUser.UserID (database user
id)

Also, I had to use "empty", "empty" for the password question. If I
leave it empty, it says that password question not valid. Any way
around this?

Thanks
Maz

Sep 7 '07 #1
1 3329
mazdotnet wrote:
Hi,

I like to grab the user id of the currently added user. However, I
can't find a property that would do it.

MembershipUser newUser = Membership.Crea teUser(tbxUsern ame.Text,
tbxPassword.Tex t,

tbxEmail.Text, "empty",
"empty",
true, out status);

I need something that would give me the newUser.UserID (database user
id)

Also, I had to use "empty", "empty" for the password question. If I
leave it empty, it says that password question not valid. Any way
around this?

Thanks
Maz
look at newUser.Provide rUserKey

HTH,
Petar Atanasov
http://a-wake.net
Sep 10 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2055
by: Portman | last post by:
I've used the Membership classes in an ASP.NET 2.0 application to create an application that interfaces with an older SQL Server 2000 database. Everything is working except the following... Like many websites, users can sign up by filling in a form. Because we're interacting with other databases, I eschewed the CreateUserWizard control and wrote my own logic programmatically, making use of the Membership.CreateUser() method. ...
3
2021
by: VB Programmer | last post by:
I am getting this error: error BC30456: 'CreateUser' is not a member of 'Membership'. What does that mean? Here's my code. It seems correct (no squigglies, etc...) ' store it in db Dim result As System.Web.Security.MembershipCreateStatus Try Dim newUser As MembershipUser = Membership.CreateUser(Me.txtUsername.Text, Me.txtPassword.Text,
4
7901
by: Ron | last post by:
Hi, I have created a custom membership provider that i use to create certain types of user accounts that only require a User Name and Password nothing else this code below works great if i use the CreateUserWizard. But if i try and create the account on my own in code behind i keep getting a status back of. "InvalidAnswer" how can i properly handle this status and correct for it.
3
3276
by: ryan.mclean | last post by:
Hello everyone, I am wondering, can the membership provider be changed at runtime? Perhaps the connectionStringName? I would like to use a different database based on the server the site is on. I suppose that a custom provider could be used to accomplish this, is there another way?
3
1813
by: John | last post by:
Hi I have a web service asmx file in a sub folders of site app root folder. With in the web service I am trying to cerate the user as below; <WebMethod()_ Public Function CreateUser(ByVal Username As String, ByVal Password As String, ByVal Email As String, ByRef ErrMsg As String) As Boolean Dim newUser As MembershipUser = Membership.CreateUser(Username, Password,
0
1466
by: Jay Pondy | last post by:
I added a Company field to the aspNet_Users table and then followed along with the MSDN docs on How to Implement a Custom Membership User by creating my inherited class from the SqlMembershipProvider and another inherited from MembershipUser to contain the new Company field. In my new Provider class I have overridden the GetUser and CreateUser methods and overloaded the CreateUser to include my new field as per the MSDN article. I have...
4
3261
by: AC | last post by:
Hi there. My asp.net 2.0 development website uses roles to control access to sections of my site, configured using the asp.net configuration tool, which is great. Except that isn't available once published on the public, third-party hosted site. So I need to be able to configure access through a new section of the site, available only to admins/developers, which I'm about to write. First off, I want to create a role in the database to...
2
1740
by: =?Utf-8?B?SXbDoW4gU2Fpbno=?= | last post by:
I ran the aspnet_regsql.exe tool with the -sqlexportonly option to create the script. I searched and replace the string by and had the dba's run the script. When I do anything like Membership.CreateUser or click on the 'security' tab in the website admin tool I get... Could not find stored procedure 'dbo.aspnet_CheckSchemaVersion'. I think this is because "dbo" is harcoded in the framework. The hosting company won't let us use the dbo...
3
1436
by: =?Utf-8?B?U2F2dm91bGlkaXMgSW9yZGFuaXM=?= | last post by:
I use SQL Server Membership provider and my data are also stored in SQL Server. But the default user fields are not enough for my users info. So I created another Users table apart from aspnet_Membership. It has a PK(uniqueidentifier) to create the reference to aspnet_Membership table and my other info columns. Having read about the Custom Membership Provider in .NET help, it says that I should create a new object inherited from...
0
8382
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8816
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8600
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7311
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.