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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:38:51+00:00 2026-06-18T05:38:51+00:00

C# code: //Here i trying to insert values in my table. case true: Connection.Connect();

  • 0

C# code: //Here i trying to insert values in my table.

 case true:
     Connection.Connect();
     int fk_pic = IdPic();
     string insertWork = "INSERT INTO work (fk_id_pic, fk_login, university, lesson, name, info, date_work, price) VALUES (@fk_pic, @fk_login, @university, @lesson, @name, @info, @date_work, @price); Allow User Variables = true;";
     MySqlCommand work = new MySqlCommand(insertWork, Connection.Connect());
     work.Parameters.AddWithValue("@fk_pic", fk_pic);
     work.Parameters.AddWithValue("@fk_login", Program.form1.login);
     work.Parameters.AddWithValue("@university", textBox1.Text);
     work.Parameters.AddWithValue("@lesson", textBox2.Text);
     work.Parameters.AddWithValue("@name", textBox3.Text);
     work.Parameters.AddWithValue("@info", richTextBox1.Text);
     work.Parameters.AddWithValue("@date_work", DateTime.Now);
     work.Parameters.AddWithValue("@ price", textBox4.Text);
     work.ExecuteNonQuery();
     Connection.Disconnect();
     break;

SQL Query:

CREATE TABLE pic 
( 
  id_pic INTEGER UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id of image', 
  caption CHAR(45) NOT NULL COMMENT 'the name of image',
  who_add CHAR(30) NOT NULL COMMENT 'who add this image',
  img LONGBLOB NOT NULL, 
  CONSTRAINT pkId_pic PRIMARY KEY(id_pic) 
) 
COMMENT 'Table for hosting images';

Don’t know what to do. Waiting for response)

  • 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-18T05:38:52+00:00Added an answer on June 18, 2026 at 5:38 am

    Change the name of the column or variable called “name”.

    name/Name is usually a reserved word.

    that might be the problem.

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

Sidebar

Related Questions

I'm trying to insert data into a table. Here's the code: void AddContacts::saveContact() {
I'm trying to insert checkboxlist multiple values in database, Here is my insert code:
I am trying to insert php variables into javascript. Here is the broken code:
I'm trying to insert some data into a table with shell_exec (on localhost). Here's
I'm trying to insert a new record into a table 'order'. Here is the
I'm trying to insert dict values into database. But i'm getting error . here
I am trying to insert a set of values in an sqlite table using
I am trying to reduce some code here. I will explain how I have
Trying to truncate some code here and running into a problem: <script type=text/javascript> $(function()
i am trying to validate someone else's code here and they are using the

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.