Solved

Has anyone had problems on goDaddy with passing data objects between classes in different directories?

Posted on 2011-09-16
6
270 Views
Last Modified: 2012-05-12
I have up loaded my web site application (ASP .NET 3.5 [C#]) to my goDaddy account. I'm starting to notice a pattern of a problem when it comes to passing data objects up through my classes. The problem is, i can't (ha). "It works on my machine" is the unfortunate truth as I have no problem When I load to goDaddy, the data objects that i build never make it back to the page that makes the initial call so I was wondering if any one else had been having this trouble or had,....had this trouble and if they'd solved it in any other way aside from placing all the data object building in the same page as the page that makes the call. as a brief over view, when my page attempts to build an object it first passes an empty object through a couple layers to get to a layer / class that i'll call "BldDtaObj". this class, 1.) builds the connection object (in a separate class) which is returned to BldDtaObj, creates the SQL command string (in a separate class) which is also returned to BldDtaObj, At this point, in BldDtaObj, the query is executed, and the original empty object passed in, is populated and returned back up to the calling page.

on my machine, no problem, on the goDaddy server the object never makes it back any ideas why?
0
Comment
Question by:mikesExpertExchange
  • 4
  • 2
6 Comments
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 36551517
here is an outlined DESCRIPTION of the execution path that my code takes...i can add as many details as needed, including actual code, (for anyone wanting to give help). just thought i'd start with a general outline of the execution path, a " 300 feet away" view, if you will...

my page passes (emptyObject) to class A
      class A passes (emptyObject) to class B
            class B passes emptyObject to BldDtaObject
                  BldDtaObject
                        -creates connection
                        -gets SQL command
                        -executes command
                        -reads data into object
                              //I'VE BEEN ABLE TO ADD SOME DEBUG CODE TO DETERMINE THAT
                              //IF, AT THIS POINT, THERE IS MORE THAN ONE RECORD ONLY THE FIRST
                              //RECORD FROM THE RESULT SET IS READ. IF THERE IS MORE, IT DOESN'T
                              //MATTER, BECAUSE MY CODE ONLY SEEMS TO FIND 1 RECORD, NO MATTER
                              //HOW MANY ARE THERE AND IT DOESN'T RETURN IT ANYWAY...
                        -should pass back filled object to class B (on my machine it does)
            class B should pass back filled object to class A (on my machine it does)
      class A should pass back filled object to my page (on my machine it does)
my page should display data in a grid (or what ever it needs to do with the data) (on my machine it does)
0
 
LVL 7

Expert Comment

by:Slimfinger
ID: 36551524
I'm very unclear on what you mean by "passing on empty object through a couple layers", etc.

If you simply mean that you have created a new object of some arbitrary type, and passed it to several functions or classes, populate it, and then pass it back, then you can be assured that your problem has nothing to do with the server.

Also, what do you mean by "never makes it back"?  Exactly what happens?  Is there an error?  Does the object return empty?  Does it return as null?  Does the program hang?

I will take a guess and assume you mean that it returns empty.  In that case, it can't be a referencing problem, since it works on your machine.  My next suspicion would be that something is wrong with your DB connection.  Have you any debug or exception info on what happens when you connect and read the data?
0
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 36551654
SlimFinger: sorry about the ambiguity, let me try to clear some of it up. Yes, you are correct about this part:

"If you simply mean that you have created a new object of some arbitrary type, and passed it to several functions or classes, populate it, and then pass it back"

When I say it never makes it back, iI mean that the object returns empty.

I have tried debugging my DB connection and it does work / it is correct. The only exception information that I get back is a null reference to my object that should not be null. below is the copied and pasted exception:


Server Error in '/' Application.
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.

Source Error:

Line 283:
Line 284:        //REQUIRED HOURS
Line 285:        txbAthleteUid.Text = slb.AthleteUid.ToString();
Line 286:        txbStudentFirstName.Text = slb.FirstName.ToString();
Line 287:        txbStudentLastName.Text = slb.LastName.ToString();


Source File: d:\hosting\8345471\html\AddEditStudent.aspx.cs    Line: 285

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   AddStudent.BindData(StudentListBase slb) in d:\hosting\8345471\html\AddEditStudent.aspx.cs:285
   AddStudent.lnkbtnFindStudent_Click(Object sender, EventArgs e) in d:\hosting\8345471\html\AddEditStudent.aspx.cs:262
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   
line 285 is from this routine below:

    private void BindData(StudentListBase slb)
    {

        //REQUIRED HOURS
        txbAthleteUid.Text = slb.AthleteUid.ToString(); //line #285
        txbStudentFirstName.Text = slb.FirstName.ToString();
        txbStudentLastName.Text = slb.LastName.ToString();
        ddlSportTeam.SelectedIndex = Utility.GetSportIdName(slb.TeamName);
        txbRequiredHours.Text = slb.RequiredHours.ToString();

        //OPTIONAL INFORMATION
        txbSemesterTotal.Text = slb.SemesterTotal.ToString();
        txbSemesterTime.Text = slb.SemesterTime;
        txbWarningCount.Text = slb.WarningCount.ToString();
        txbNotes.Text = slb.Notes;
        txbWeekTotal.Text = slb.WeekTotal;
        txbBankedMinutes.Text = slb.BankedMinutes.ToString();
        txbBankedTime.Text = slb.BankedTime;
        txbTotalMinutesCurrentWeek.Text = slb.TotalMinutes.ToString();
        txbUsedBankedMinutes.Text = slb.UsedBankedMinutes.ToString();
        txbGPA.Text = slb.GPA;
        txbMajor.Text = slb.Major;
        if (slb.Active)
            cbxActive.Checked = true;
        else
            cbxActive.Checked = false;

        mvStudentInfo.ActiveViewIndex = 2;
    }

this routine gets called from the following segment of code in a different rountine routine (all on my main page):

        if (rb1 != null)
        {
            if (rb1.Checked)
            {
//THIS LINE HERE STARTS THE CALLS THAT ARE SUPPOSED TO POPULATE THE OBJECT "slb" and eventually return it. i assume that the object itself isn't null as it is making into the BindData call
                slb = StudentListProcessor.FindStudentByFullName(txb.Text);
                if (slb != null)
                    BindData(slb);
                mvStudentInfo.ActiveViewIndex = 0;
            }
            else if (rb2.Checked)
            {
                slb = StudentListProcessor.FindStudentByStudentID(txb.Text);
                if (slb != null)
                    BindData(slb);
                mvStudentInfo.ActiveViewIndex = 0;
            }
            Mode = "Edit";
            btnAddEditStudent.Text = "Update Student Info";
            lblAddEditStudent.Text = "Update Student Info";
            pnlUpdateConfirmation.Visible = false;
        }

Open in new window

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 7

Accepted Solution

by:
Slimfinger earned 500 total points
ID: 36551712
It looks to me like it's not 'slb' that is null, but its member var 'AthleteUid', which is not getting set in FindStudentByFullName().
0
 
LVL 1

Author Comment

by:mikesExpertExchange
ID: 36551889
well i made some changes and I think you're right about just about everything. It's actually returning only the AthleteUid piece of information now...none of the other fields have data seemingly...
0
 
LVL 1

Author Closing Comment

by:mikesExpertExchange
ID: 36560619
in essence, you were correct,...i had misspelled the name of one the fields on a table so the application was just eating the exception
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now