Update problem

Posts   
 
    
lgege
User
Posts: 27
Joined: 01-Sep-2005
# Posted on: 06-Sep-2005 02:47:18   

Hi,

I was trying to update the fields of an entity. but when I called saveentity method, i always got the error below. If i comment out the saveentity line i don't get any errors. I am sure all the fields i tried to update are not empty. I suspect there might be other fields that I need to attend to, but not sure which ones. Do you know what might be the problem?

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.

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 06-Sep-2005 10:32:25   

1) when you get an exception, ALWAYS paste the stacktrace. Only then we know where the exception was thrown 2) please check if you've updated the assembly compiled from your dbspecific project in the webapp's bin folder. It might be that one is out of sync with the dbgeneric assembly.

Frans Bouma | Lead developer LLBLGen Pro
lgege
User
Posts: 27
Joined: 01-Sep-2005
# Posted on: 06-Sep-2005 16:02:16   

Below is the stack trace. I updated reference classes as you suggested, which didn't solve the problem.

Source Error:

Line 141: For Each item In ZipsToUpdate Line 142: Response.Write(item.ToString & " " & dropTerritory.SelectedValue & " " & txtStart.Text & " " & txtEnd.Text & " " & isActive & vbCrLf) Line 143: Response.Write(FranchiseManager.ZipMassUpDate(item, New Guid(dropTerritory.SelectedValue), sd, ed, True) & vbCrLf) Line 144: Next Line 145:

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +264 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +877 Sears.UltraCare.BL.RM.Interfaces.IFranchiseManager.ZipMassUpDate(Guid ZipTerritoryID, Guid TerritoryID, DateTime StartDate, DateTime Enddate, Boolean isActive) +0 Sears.UltraCare.PL.UltraCareWeb.ZipMassUpdate.btnUpdate_Click(Object sender, EventArgs e) in C:#local files\clients\sears\phase1\Construction\Code\UltraCareWeb\WebModules\Admin\UserControls\ZipMassUpdate.ascx.vb:143 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() +1277

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 06-Sep-2005 16:38:01   

The exception originates in your own code. dropTerritory is Nothing (null) I think. Could you check that please with a breakpoint in the debugger?

Frans Bouma | Lead developer LLBLGen Pro