Hi,
Why not uploaded the data into db?
Do not show any error.
string City = "Berlin";
string MyConString = "SERVER=localhost;" +
"DATABASE=test;" +
"UID=root;" +
"PASSWORD=;";
MySqlConnection connection = new MySqlConnection(MyConString);
MySqlCommand command = connection.CreateCommand();
command.CommandText = "insert into city(city) VALUES (@City)";
command.Parameters.Add(new MySqlParameter("@City", MySqlDbType.VarChar, 40)).Value = City;
try
{
connection.Open();
command.ExecuteNonQuery();
}
catch (Exception ex)
{
error.Text = "error" + ex.Message;
}
finally
{
connection.Close();
error.Text = "OK";
}