Solved

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

Posted on 2011-09-16
6
282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Bill Nolan
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Accepted Solution

by:
Bill Nolan 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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