473,320 Members | 1,846 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,320 software developers and data experts.

Error approving membership user

Hi

I am trying to approve a user as below;

Dim User As MembershipUser
User = Membership.GetUser("MyUsername")
User.IsApproved = False

I am getting an "Object reference not set to an instance of an object."
error on the last line. What is the problem and how can I fix it?

Thanks

Regards
Jun 1 '08 #1
2 1241
User = Membership.GetUser("MyUsername")

You are sure that this gives a user back?

Cor
Jun 2 '08 #2
If GetUser() is returning null, then there was probably no user found with
the specified username.

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

"John" <in**@nospam.infovis.co.ukwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hi

I am trying to approve a user as below;

Dim User As MembershipUser
User = Membership.GetUser("MyUsername")
User.IsApproved = False

I am getting an "Object reference not set to an instance of an object."
error on the last line. What is the problem and how can I fix it?

Thanks

Regards

Jun 2 '08 #3

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

Similar topics

3
by: mrwoopey | last post by:
Hi, I am using the example "Authenticate against the Active Directory by Using Forms Authentication and Visual Basic .NET": http://support.microsoft.com/default.aspx?scid=KB;EN-US;326340 ...
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: =?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...
3
by: Ted | last post by:
In WSAT, I get the following error when trying to set up my provider: Could not establish a connection to the database. If you have not yet created the SQL Server database, exit the Web Site...
3
by: Glenn | last post by:
My current classic-ASP site has users, projects, roles and the 2.0 membership looks like a perfect fit, but I'm having trouble finding examples of how to have users that belong to different...
6
by: Jonathan Wood | last post by:
Although this will be a challenge at my level of ASP.NET knowledge, I'm thinking I should implement my own membership provider class. Looking over the methods I must implement, a number of...
2
by: John | last post by:
Hi I am trying to approve a user as below; Dim User As MembershipUser User = Membership.GetUser("MyUsername") User.IsApproved = False I am getting an "Object reference not set to an...
4
by: John | last post by:
Hi 1. Is it possible to disable a user without deleting? 2. Is it possible to add user fields to the membership db such as app's on id for a user? Thanks Regards
3
by: dm3281 | last post by:
Hello -- I need to write an ASP.NET 2.0 application for our clients to use to login and verify file transmissions. Each client will need their own logon, in addition to a way to assign each...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.