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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:34:06+00:00 2026-05-31T20:34:06+00:00

hello all this seems to be my problem I have a table in mysql

  • 0

hello all this seems to be my problem
I have a table in mysql and am making a c# app when trying to insert i get a You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘OIL COMPANY)’ at line 1 which is my companyVal. it will insert with one value and a default for all others but i add the second value it errors out

        string ConnectionString2 = ConfigurationSettings.AppSettings["ConnectionString2"];
        MySqlConnection connection2;
        connection2 = new MySqlConnection(ConnectionString2);
        connection2.Open();
        MySqlCommand command = new MySqlCommand("INSERT INTO spt_proposal     (lab_Prop_Id,customer_Name) VALUE (" + a + "," + companyVal + ")", connection2);
        command.ExecuteNonQuery();
        connection2.Close();

Brent

  • 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-31T20:34:07+00:00Added an answer on May 31, 2026 at 8:34 pm

    You are missing quotes round your strings and VALUE should be VALUES:

    string sql = "INSERT ... VALUES ('" + a + "','" + companyVal + "')";
    

    Also I’d advise you to use parameterized queries.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem Hello all! I have this code which takes my jpg image loops through
Hello all i have a simple problem i have a alertDialog and i want
hello all I have a small dialog which I created dynamically, which has a
This is a strange problem that I am having with WCF trying to send
I have what seems like a simple problem, but searching the net hasn't yielded
I have searched this web looking for an answer, but it seems that this
I have a compiling problem. I followed tutorial about Hello world program for Android
This is a very strange problem. I've got a rails app in which I
I have a form like this: <form id=form_main name=form_main action=/search/ target=iframe001 method=get onSubmit=reset_and_subm();> Enter
I have the following scenario: Table 1: articles id article_text category author_id 1 hello

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.