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 9029277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:12:45+00:00 2026-06-16T07:12:45+00:00

I am trying to select all (*) the data columns on one table accompanied

  • 0

I am trying to select all (*) the data columns on one table accompanied by INNER JOINing another table to get the menu item name. Please have a look at my query

string query = "SELECT ol.*, m.menu_name " +
                "FROM orderlist ol " +
                "INNER JOIN menudb m " +
                "ON m.menu_ID = ol.menu_ID " +
                "WHERE ol.order_ID = @orderID";

I can’t seem to get the m.menu_name when I retrieve it using dr["menu_name"].ToString()

Any ideas why?

orderlist Table Columns

orderlist_ID order_ID menu_ID order_quantity

menudb Table Columns

menu_ID menu_name menu_price menu_description menu_category menu_status

  • 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-16T07:12:46+00:00Added an answer on June 16, 2026 at 7:12 am

    There are many problems in your query.

    First, you have a syntax error due to lack of spaces between keywords.

    "ON m.menu_ID = ol.menu_ID" +     // << HERE
    "WHERE ol.order_ID = '@orderID'";
    

    you should have add an extra space after ol.menu_ID

    "ON m.menu_ID = ol.menu_ID " +
    "WHERE ol.order_ID = '@orderID'";
    

    Second, if you parameterized the query, you should not wrap the parameter with a single quote. This causes to be a string and not a parameter anymore.

    "WHERE ol.order_ID = @orderID"; // remove single quote
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to pull data from one table, compare columns to a variable,
I am trying to use all columns for each row from one table (party),
I am trying to get what all fields(input,select) are changed during keyup and change
I'm in the process of importing data from one table to another with a
I need to copy some data from one table to another but I need
I am trying to insert into a table all data but change just the
I am trying to merge some columns from one table into a view that
I’m trying to display two columns in my table view, one being a title
I am trying to take the data from one table and move it over
I trying to select all li elements at second level of the list add

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.