0

Friends, I'm getting this error message and I do not know how to solve it, I've never seen this before.

The following error message is displayed:

SDPJ-V3.1.0 \ SDPJ-102 \ SDPJDomain \ DataAccess \ ProcessInterestData.O.cs: line 41 In SDPJDomain.DataAccess.InteraseDataO.InsertOrUpdate (ProcessInteratedDoc type) in D: \ SVN \ SDP \ SDPJ \ in SDPJDominio.APL.AplProcessInterest.save (Process InterestedInterested process) in D: \ SVN \ SDP \ SDPJ \ branches \ SDPJ-V3.1.0 \ SDPJ-102 \ SDPJDomain \ APL \ AplProcessInterest.cs: line 15 in SDPJView.ImportProcessView.ImportProcess.Import_Click (Object sender, EventArgs e) in D: \ SVN \ SDP \ SDPJ \ branches \ SDPJ-V3.1.0 \ SDPJ-102 \ SDPJView \ ImportProcessView \ ImportProcess.aspx.cs: line 158 in System.Web.UI.WebControls.Button.OnClick (EventArgs and) in System.Web.UI.WebControls.Button.RaisePostBackEvent (String eventArgument) at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (String eventArgument) in System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, String eventArgument) in System.Web.UI.Page.RaisePostBackEvent (NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain (Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

I am new here and new to the programming world and have never witnessed this.

//Regarding the Process InterestsData.cs: line 41

public static void InsertOrUpdate(ProcessInterested typeDoc)
{

    ISession session = NhibernateHelper.CurrentSession;
    ITransaction transaction = session.BeginTransaction();
    try
    {
        session.Clear();
        session.SaveOrUpdate(typeDoc);
        transaction.Commit();
    }
    catch (Exception e)
    {

        transaction.Rollback();
        throw new Exception(e.ToString());
    }
}

//Regarding Interacted Application: line 15

public class AplProcessedInterests
{

    public void save(ProcessInterested processInterested)
    {
        ProcessInterestedDAO.InsertOrUpdate(processInterested);
    }
}       

//Regarding ImportProcessView \ ImportProcess.aspx.cs: line 158

if (WriteProcInter.Count! = 0)
{
   foreach (ProcessInterested item in listRecordProcInter)
   {
        aplProcessInterested.save (item);
   }
}
stuartd
  • 62,136
  • 13
  • 120
  • 150
  • Please determine *which line* in the first snippet is line 41, and mark it accordingly in your question. – 15ee8f99-57ff-4f92-890c-b56153 May 17 '18 at 14:36
  • P.S. please don't do stuff like `throw new Exception(e.ToString());`. Just `throw;` to rethrow. – 15ee8f99-57ff-4f92-890c-b56153 May 17 '18 at 14:37
  • 2
    You've given us the stack trace but not the error message. – DavidG May 17 '18 at 14:39
  • Ed Plunkett sorry, but the line this is ITransaction transaction = session.BeginTransaction(); – user9789539 May 17 '18 at 14:43
  • DavidG, Message: nullreferenceexception was unhandled by user code – user9789539 May 17 '18 at 14:45
  • Ed Plunket following your guidance regarding throw, I made the change here in my code and stopped giving that error, you and the other colleagues of the forum who are experienced in the subject, this type of error is one of the factors that can influence in the moment of compilation? – user9789539 May 17 '18 at 14:53
  • Friends even after the change I returned to present the same message of this error. – user9789539 May 17 '18 at 16:29
  • @user9789539 That change was unrelated to your error. It was just good general policy. What part of "mark it accordingly in your question" was unclear to you? Please be complete and specific. In any case, [the duplicate question](https://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) will show you what steps you can follow to resolve this and all future problems with the same error. – 15ee8f99-57ff-4f92-890c-b56153 May 17 '18 at 16:37

0 Answers0