public string dodaj1pole(string tabela1, string pole1, string wartosc)
{
string sqlString = null;
sqlString = "INSERT INTO'"+tabela1+"'('"+pole1+"') VALUES ('"+ wartosc+"');";
return sqlString;
}
wywołanie:
string kwerenda = dodaj.dodaj1pole("pilkarze","imie",textBox2.Text);
błąd przy próbie dodania:
An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll
Additional information: 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 ''pilkarze'('imie') VALUES ('444')' at line 1
Co tutaj może być nie tak?
dodanie znacznika <code>
- @furious programming