Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6020897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:38:04+00:00 2026-05-23T03:38:04+00:00

I’m taking my first steps in oop, and right now I’m re-building a practice

  • 0

I’m taking my first steps in oop, and right now I’m re-building a practice project to make it n-tiered and oo. I have a query on my data layer that inner joins three tables and selects the row where SubmissionId = x; the business layer has a service object that returns the row to the presentation layer, but when I hit presentation I hit a snag. I’ve been assured that an un-assigned variable on the data layer will be fine as long as it’s defined on the presentation layer, but I don’t know how to call it properly. Thoughts? Code below:

Data layer //this falls under the public class SubmissionDatabaseService //

  public Submission GetSubmissionsByID()
{


      string viewQuery = "SELECT Submission.SubmissionId, Customer.CustName, Customer.SicNaic, Customer.CustCity, Customer.CustAddress, Customer.CustState, Customer.CustZip, Broker.BroName, Broker.BroCity, Broker.BroAddress, Broker.BroState, Broker.BroZip, Broker.EntityType, Submission.Coverage, Submission.CurrentCoverage, Submission.PrimEx, Submission.Retention, Submission.EffectiveDate, Submission.Commission, Submission.Premium, Submission.Comments FROM Submission INNER JOIN Broker ON Broker.BroId = Submission.BroId INNER JOIN Customer ON Customer.CustId = Submission.CustId WHERE Submission.SubmissionId =" + x;
      string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["MyConnectionString"].ConnectionString;
      SqlConnection conn = new SqlConnection(connectionString);



      conn.Open();

      SqlCommand viewCmd = new SqlCommand(viewQuery, conn);
      SqlDataReader dr = viewCmd.ExecuteReader();
      Submission tempSubmission = new Submission();

          tempSubmission.SubmissionId1 = dr.GetInt32(0);
          tempSubmission._Cust.CustName1 = dr.GetString(1);
          tempSubmission._Cust.SicNaic1 = dr.GetInt32(2);
          tempSubmission._Cust.CustCity1 = dr.GetString(3);
          tempSubmission._Cust.CustAddress1 = dr.GetString(4);
          tempSubmission._Cust.CustState1 = dr.GetString(5);
          tempSubmission._Cust.CustZip1 = dr.GetInt32(6);
          tempSubmission._Bro.BroName1 = dr.GetString(7);
          tempSubmission._Bro.BroCity1 = dr.GetString(8);
          tempSubmission._Bro.BroAddress1 = dr.GetString(9);
          tempSubmission._Bro.BroState1 = dr.GetString(8);
          tempSubmission._Bro.BroZip1 = dr.GetInt32(11);
          tempSubmission._Bro.Entity1 = dr.GetString(12);
          tempSubmission._SubCov.Coverage1 = dr.GetInt32(13);
          tempSubmission._SubCov.CurrentCoverage1 = dr.GetInt32(14);
          tempSubmission._SubCov.PrimEx1 = dr.GetInt32(15);
          tempSubmission._SubCov.Retention1 = dr.GetInt32(16);
          tempSubmission._SubCov.EffectiveDate1 = dr.GetDateTime(17);
          tempSubmission._SubCov.Commission1 = dr.GetInt32(18);
          tempSubmission._SubCov.Premium1 = dr.GetInt32(19);
          tempSubmission._SubCov.Comment1 = dr.GetString(20);

          return tempSubmission;
}

Business Logic layer

public class SubmissionService

{

public Submission getSubmissionByID()
{
    SubmissionDatabaseService sds = new SubmissionDatabaseService();
    return sds.GetSubmissionsByID();
}

}

Presentation Layer

 protected void Page_Load(object sender, EventArgs e)
{

    string x = Request.QueryString["SubmissionId"];


    Submission sub = SubmissionService.getSubmissionByID(x); //Here is where I throw an overload error
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T03:38:05+00:00Added an answer on May 23, 2026 at 3:38 am

    SubmissionService.getSubmissionByID() does not take a parameter. so you can’t pass x. Change it’s signature in the Business Layer like this.

    public Submission getSubmissionByID(string x)
    {
        SubmissionDatabaseService sds = new SubmissionDatabaseService();
        return sds.GetSubmissionsByID(s);
    }
    

    and in the Data layer like this

    public Submission GetSubmissionsByID(string x)
    {
    
    
          string viewQuery = "SELECT Submission.SubmissionId, Customer.CustName, Customer.SicNaic, Customer.CustCity, Customer.CustAddress, Customer.CustState, Customer.CustZip, Broker.BroName, Broker.BroCity, Broker.BroAddress, Broker.BroState, Broker.BroZip, Broker.EntityType, Submission.Coverage, Submission.CurrentCoverage, Submission.PrimEx, Submission.Retention, Submission.EffectiveDate, Submission.Commission, Submission.Premium, Submission.Comments FROM Submission INNER JOIN Broker ON Broker.BroId = Submission.BroId INNER JOIN Customer ON Customer.CustId = Submission.CustId WHERE Submission.SubmissionId =" + x;
          ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I have a jquery bug and I've been looking for hours now, I can't
We're building an app, our first using Rails 3, and we're having to build
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.