473,412 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

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.CreateUser(tbxUsername.Text,
tbxPassword.Text,

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 3317
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.CreateUser(tbxUsername.Text,
tbxPassword.Text,

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.ProviderUserKey

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
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...
3
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...
4
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...
3
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...
3
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...
0
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...
4
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...
2
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...
3
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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,...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.