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

  • SEARCH
  • Home
  • 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 7820819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:26:35+00:00 2026-06-02T07:26:35+00:00

I had a long query in access and trying to make it into multiple

  • 0

I had a long query in access and trying to make it into multiple lines so that i can check them during my debugging and I tried the steps which I found through google and its failing with the information shown below.

    public DataSet showallCompanyPaymentbyjobcode(int jobpk ,int confirmquotationpk)
        {

            string query=SELECT companypaymentmastertable.paymentpk, companypaymentmastertable.cmpinvoice, companypaymentmastertable.jobcode, companypaymentmastertable.customercode, confirmquotationmastertable.quotationcode, companypaymentmastertable.customerName, companypaymentmastertable.ischeque, companypaymentmastertable.isCash, companypaymentmastertable.amount, companypaymentmastertable.chequenumber, companypaymentmastertable.bankname, companypaymentmastertable.chequedate, companypaymentmastertable.chequereleasedate, companypaymentmastertable.companypaymentdate
FROM confirmquotationmastertable INNER JOIN companypaymentmastertable ON confirmquotationmastertable.confirmpk=companypaymentmastertable.confirmpk
WHERE (((companypaymentmastertable.confirmpk)=[?]) AND ((companypaymentmastertable.jobpk)=15));


                               OleDbDataAdapter dAdapter = new OleDbDataAdapter(query, Program.ConnStr);
                DataSet ds = new DataSet();
                dAdapter.Fill(ds, "tblpayview");

                if (ds.Tables.Count <= 0)
                {
                    ds = null;    
                }

                return ds;

            }

in another class i called it

 public void fillpaymenttable()
        {
            DataSet ds= new DataSet();
            ds= companytransaction.showallCompanyPaymentbyjobcode(cmbjobcode.SelectedValue,cmbQuotationcode.SelectedValue);

             tblpaymentview.DataSource = ds.Tables["tblpayview"].DefaultView;

                if (ds.Tables.Count <= 0)
                {
                    lblstatus.Text = "No Payment Details Present";
                    clearcontrols();
                }

            }

Is there any way to split the query and whether this function work if dataset called like this?

  • 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-06-02T07:26:38+00:00Added an answer on June 2, 2026 at 7:26 am

    This would be more efficient than using a stringbuilder, because the string concatenation will be performed at compile time, not at run time:

    string query="SELECT companypaymentmastertable.paymentpk, companypaymentmastertable.cmpinvoice, "
     + "companypaymentmastertable.jobcode, companypaymentmastertable.customercode, "
     + "confirmquotationmastertable.quotationcode, companypaymentmastertable.customerName, "
     + "companypaymentmastertable.ischeque, companypaymentmastertable.isCash, companypaymentmastertable.amount, "
     + "companypaymentmastertable.chequenumber, companypaymentmastertable.bankname, companypaymentmastertable.chequedate, "
     + "companypaymentmastertable.chequereleasedate, companypaymentmastertable.companypaymentdate "
     + "FROM confirmquotationmastertable INNER JOIN companypaymentmastertable ON "
     + "confirmquotationmastertable.confirmpk=companypaymentmastertable.confirmpk "
     + "WHERE (((companypaymentmastertable.confirmpk)=[?]) AND ((companypaymentmastertable.jobpk)=15));"
    

    Alternatively, you could use a “verbatim string”:

        string query= @"SELECT companypaymentmastertable.paymentpk, companypaymentmastertable.cmpinvoice, 
    companypaymentmastertable.jobcode, companypaymentmastertable.customercode, 
    confirmquotationmastertable.quotationcode, companypaymentmastertable.customerName, 
    companypaymentmastertable.ischeque, companypaymentmastertable.isCash, companypaymentmastertable.amount, 
    companypaymentmastertable.chequenumber, companypaymentmastertable.bankname, companypaymentmastertable.chequedate, 
    companypaymentmastertable.chequereleasedate, companypaymentmastertable.companypaymentdate    
    FROM confirmquotationmastertable 
    INNER JOIN companypaymentmastertable ON confirmquotationmastertable.confirmpk=companypaymentmastertable.confirmpk    
    WHERE (((companypaymentmastertable.confirmpk)=[?]) AND ((companypaymentmastertable.jobpk)=15));";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Had a good search here but can't see anything that gets my mind in
When I try to run this query in Access through the ODBC interface into
Say you had a long array of chars that are either 1 or 0,
One thing with which I have long had problems, within the CakePHP framework, is
In another question I had the problem to port the code: unsigned long stack[]
I am a long time C# developer and have had to look at some
It's been a long time since I've had to deal with Win32 menus. I
Has anyone had this problem? My projects tend to have some long XML files
Had a page that was working fine. Only change I made was to add
Had a problem with the recursive conflictCheck() method. That seems fine now. I have

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.