Looking for the v10 manual? Visit our new user's guide!
 
Search Descriptions Version
 
 
This article applies to: ML v7, ML8, MultiStore

Object Reference not set to an instance of an object when signing into the admin


Symptoms
Site throws a hard error - Object Reference not set to an instance of an object when signing into the admin section on these lines:

VB:
Return
Else
LoginOK = c.CheckLogin(PasswordField)
End If
If (Not LoginOK) Then

C#:
else
{
LoginOK = c.CheckLogin(PasswordField);
}
if(!LoginOK)

in Admin/signin.aspx.cs or Admin/signin.aspx.vb

Cause
This is usually related to the inadvertent removal of the primary keys from the tables in the database (particularly the CustomerSession table)

Solution
The easiest solution is to restore the database to a point before the primary keys were removed.  If this is not possible, you will need to browse through the original database installation script and find all of the primary keys and contraints...manually adding each one back to the database.  The only other option is to recreate the database from scratch and migrate your information from the old database to the clean database.

More Information
AspDotNetStorefront Support Staff cannot assist with this.  You will need to find a qualified DBA or IT professional if you are unable to determine how to do this.