Im tring to save data on mysql db but i always get "Column count doesn't match value count at row 1"
I tried to recode this sql command, seen some videos about this but cant found nothing that work
string Insert =
"INSERT INTO db.pcs(Nome,Marca,Utilizador,Ram,CPU,Disco,TipoSO,SO,Licenca,TipoPC,ProgramaseLicenca) VALUES('"
+ nome + "," + marca + "," + user + "," + ram + ","
+ cpu + "," + disco + "," + tiposo + "," + so + ","
+ lice + "," + tipopc + "," + progs + "')";
using (MySqlConnection cn = new MySqlConnection(connst))
{
cn.Open();
MySqlCommand cmd = new MySqlCommand(Insert, cn);
try
{
if (cmd.ExecuteNonQuery() == 1)
{
pb1.Visible = true;
timer1.Start();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Its supose to add to db but on the try messagebox i get "Column count doesn't match value count at row 1
"