473,473 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Membership Database - Account Expiration

I have a customer who would like to set an expiration date on user accounts
to 30 days. I'm using Asp.net 2.0 (VS 2005) with the default membership
database and forms authentication.

How do I query the membership database? I see a createdate field that I
believe is what I want, but I'm just not familiar with customizing the user
accounts in the membership database.
Oct 5 '06 #1
3 2432
Check this link -
http://www.devx.com/asp/Article/29256/0/page/2
--
Ameet Phadnis
Sr. Technical Consultant
e Tek Global Inc.
ASP Alliance Author Page: http://aspalliance.com/author.aspx?uId=44260
"netsecsvc" wrote:
I have a customer who would like to set an expiration date on user accounts
to 30 days. I'm using Asp.net 2.0 (VS 2005) with the default membership
database and forms authentication.

How do I query the membership database? I see a createdate field that I
believe is what I want, but I'm just not familiar with customizing the user
accounts in the membership database.
Oct 5 '06 #2
Let me be more clear. I am familiar with VS2003 and the dataadapter,
sqlconnection and dataset, etc. But in VS2005 those seem to be replaced with
the SQLDATASOURCE. I went ahead and configured a SQLDATASOURCE so it should
provide the results I want from the membership database -- that seems really
straightforward. But now how do I get the results from that sqldatasource?
I know how to databind with it, but I don't want to databind, I just want its
results. Here is what I'm thinking...obviously there is no "RESULTS"
method...

DateTime createdate=Convert.ToDateTime(SqlDataSource1.RESUL TS!!!);
DateTime now = DateTime.Now;
if (now createdate.AddDays(30))
{
Label1.Visible = true;
Session.Abandon();
}
Oct 5 '06 #3
Hello netsecsvc,

All the user attributes are available via the MembershipUser object. You can
find the CreationDate (also, the LastActivityDate, which might be more
interesting to you) for the user by:

MembershipUser user = Membership.GetUser();
lblCreationDate.Text = user.CreationDate.ToString();
lblLastActiveDate.Text = user.LastActivityDate.ToString();

--
brians
http://www.limbertech.com
"netsecsvc" wrote:
I have a customer who would like to set an expiration date on user accounts
to 30 days. I'm using Asp.net 2.0 (VS 2005) with the default membership
database and forms authentication.

How do I query the membership database? I see a createdate field that I
believe is what I want, but I'm just not familiar with customizing the user
accounts in the membership database.
Oct 5 '06 #4

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

Similar topics

3
by: Carl M. | last post by:
Okay, I'm 18 hours into this now and am at a loss. What I've done is create an application on my local workstation using VWD Express using the membership/roles provider and SQL Server Express...
5
by: Vishal Gupta | last post by:
Hi This is Vishal this side.I have been trying to create a new sample website using the new Membership Provider Class. Now when I try to a create a new website and then hit on the Website...
2
by: Michael | last post by:
Hello, I am using the Membership control in my asp.net application. When a person registers, I set the account to not active. CreateUserWizard1.Enabled = false; Then I send them an email...
3
by: Carlos | last post by:
Hi all, I am trying to figure out how to deal with the membership provider. I used the aspnet_regsql to create the aspnetdb database in my sqlserver2005 instance of my server. I noticed that the...
4
by: =?Utf-8?B?Q2hyaXMgQ2Fw?= | last post by:
I have been having some trouble with implementing a custom Membership Provider. We have a custom data store and business logic that pulls user information. I need some level of functionality...
4
by: =?Utf-8?B?U2FsYW1FbGlhcw==?= | last post by:
Hi, I am trying to play with the Survey manager application provided gracefully by Microsoft at "http://msdn.microsoft.com/vstudio/express/sql/samples/" VB team(so many thanks), compiled the win...
3
by: GaryDean | last post by:
I have serveral applications now running that are using the MembershipProvider classes and they are each using their own security tables in SQL Server 2005 instead of the express databases - they...
1
by: Paul | last post by:
Hello All, I am having trouble with ASP,NET Membership. The membership account is not being created in the App_Code folder as it should. It has been suggested to me that perhaps this is because...
2
by: Bobby Edward | last post by:
My site is utilizing asp.net membership. It works perfect on the development machine. I copied the entire directory to the production server. Now it seems that the membership stuff is acting...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
1
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: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
muto222
php
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.