473,387 Members | 3,781 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,387 software developers and data experts.

Inherited Membership Provider - Object Reference not set Exception

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 overridden the SQLMembershipProvider.Initialize method so I can gain
access to the Connection string after which I call MyBase.Initialize.

I have a simple form with the ASP:Login control and when I attempt to login in I
receive a Configuration Error exception complaining that "Object reference not
set to an instance of an object" that highlights my new Membership provider type
in the Config file.

If I understand all of this correctly my web.config membership section should be
telling the Login control to instantiate my new class and then it calls my
overridden Initialize method and things pick up from there.

Based on the exception I am getting it sounds like the Login control is NOT
instantiating my new class.

<membership defaultProvider="UDSSQLMembershipProvider" hashAlgorithmType="None">
<providers>
<add name="UDSSQLMembershipProvider"
type="UDSSQLMembershipProvider"
connectionStringName="Common"
applicationName="UDSDMS.Demo"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
minRequiredPasswordLength="7"
minRequiredNonalphanumericCharacters="0"
passwordFormat="Clear" />
</providers>
</membership>
Mar 18 '07 #1
0 1454

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

Similar topics

0
by: Nate Hekman | last post by:
I'm trying to set up a Membership/Role Provider for an ASP.NET 2.0 beta 2 site using SqlMembershipProvider, and am having problems configuring SQL Server. I'm comfortable with ASP.NET but very...
2
by: John | last post by:
Hi I was working fine with create user wizard and the default membership provider. I have now customised the membership provider as per attached web.config. The create user wizard picks up the...
8
by: VB Programmer | last post by:
I would appreciate your assistance on this ASP.NET 2.0 site.... This is the wierd problem: While accessing the built in .NET functions for 'profiling' or 'membership' an error is generated (see...
9
by: Paul Keegstra | last post by:
Hi, I am currently working on an asp.net 2.0 web site that is a replacement of a classic asp web site. The current web site uses a Commerce Server 2002 database for storing user information. ...
2
by: Balaji | last post by:
Hi All, Can I use more than one membership provider for a given website? I understand only one of them could be default one. If yes, then how to programmatically access the other membership...
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...
4
by: thomas | last post by:
Hello All, How to change the default Membership Provider during the runtime? I know I can reference any provider I want, e.g.: provider = Membership.Providers but the question is how to...
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: Ben | last post by:
Hi, i have already posted a more or less similar thread but it's gone unsolved with the flow of the other threads .. When an anonymous user has created an new account (with the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.