Insert Error: Incorrect integer value 'EXAMPLE' for column 'id_example' at row 1

1

I am trying to insert into my mySQL database through Visual Studio 2017 - C # (localhost-wamppserver) but it is giving error.

The first column of the records table is the record_id which is the primary key of the records table and is auto_increment and therefore I did not specify it in Insert Into.

But for some reason the error is occurring when inserting in the type_id that is the foreign key of the types table, I think it will be because it is using a combobox with the values of the type_name column of the types table and inserting the records in the records table because the fields with textbox are perfect, the error is described below and in the question title.

Is it because the values in the combobox are text and the column I am inserting is a foreign key INT?

I'm having the following error when inserting:

Incorrect integer value: 'TEXT' for column 'id_tipos' at row 1

My query:

string query = "INSERT INTO 'registos'('data', 'id_tipos', 'id_tec','id_processo', 'id_tarefa', 'horas', 'com') VALUES ('" + datatp_1.Text + "','" + comboBox_tipo1.Text + "','" + comboBox_tec1.Text + "','" + comboBox_pro1.Text + "','" + comboBox_passos1.Text + "','" + txt_horas1.Text + "','" + txt_com1.Text + "')";

My query select * from records:

Myqueryselect*fromrecords+INNERJOIN:

    
asked by anonymous 01.06.2018 / 11:48

0 answers