CodeToad Forums » ASP.Net » ASP.Net Error - System.NullReferenceException: Object reference not set to an instance of an object.
|
|
|
Hey, I am having the following error when i hit the add item to cart button on my asp.net shopping cart.
I have no idea how to fix it. I have provided the error and line of code that causes it. Any help would be appreciated,
Thanks,
Jen
error
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Code (line 56 causes the error)
Line 54: searchdatarow = searchCartTable.NewRow()
Line 55: searchdatarow("CDID") = CDID
Line 56: searchdatarow("Artist") = objItemInfo.Tables("Inventory").Rows(0).Item("Artist")
Line 57: searchdatarow("InventoryQuantity") = 1
Line 58: searchdatarow("Price") = objItemInfo.Tables("Inventory").Rows(0).Item("Price")
|
|
|
|
|
|
|
// |