Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.NullReferenceException: Object reference not set to an instance

Status
Not open for further replies.

earme

Programmer
Jul 27, 2000
155
US
System.NullReferenceException: Object reference not set to an instance of an object.

This is the error that I'm getting in my asp .net cs2002 application. The website is working fine on my development box, but when I unpackaged it onto the production machine I keep getting errors. This specific error occurs when I try to add an item to the basket. It's not even making it to the onclick event.

This is the stack trace:
Code:
[NullReferenceException: Object reference not set to an instance of an object.]
   Microsoft.CommerceServer.Site.Transactions.AddToCart.Submit_Clicked(Object sender, EventArgs e) +55
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain() +1247

I also get a similar error when attempting to view the basket. Also, it won't allow me to create an account through the website. In commerce server manager the profile connection works.
Any suggestions?

Earme
 
the problem was we were missing the field u_keyindex in the UserObject table. It wasn't in the profileSql.sql script and I didn't add it. Soo, if anyone else gets this error, check that you have all the fields in the userObject table and then check to make sure that you have all the other profile tables (I didn't have the credit card table either).
So, you might want to create the profile script yourself next time you need to package that site.

Earme
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top