ERROR 1064(42000)适用于WebSQL,但不适用于MySQL

时间:2017-01-03 16:13:49

标签: mysql sql web-sql

使用mysql运行此查询时,

string insertQuery = "INSERT INTO db_personal(per_image,per_Fname,per_Mname,per_Lname)VALUES(@per_image,@per_Fname,@per_Mname,@per_Lname)";

connection.Open();

MySqlCommand cmd = new MySqlCommand(insertQuery, connection);
cmd.Parameters.AddWithValue("@per_image", newPicture.Image);
cmd.Parameters.AddWithValue("@per_Fname", newFirstName.Text);
cmd.Parameters.AddWithValue("@per_Mname", newMiddleName.Text);
cmd.Parameters.AddWithValue("@per_Lname", newLastName.Text);

try
{
    if (cmd.ExecuteNonQuery() == 1)
    {
        MetroFramework.MetroMessageBox.Show(this, "New student information has been successfully saved.", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
    else
    {
        MetroFramework.MetroMessageBox.Show(this, "Incomplete information. Are you sure you want to save?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
    }
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message);
}

connection.Close();

我收到了

  

错误1064(42000):您的SQL语法有错误;检查与您的MySQL服务器版本对应的手册,以便在'附近使用正确的语法       选择t1.country_code,t1.freq       来自avg_call country_code_final t1
      联合所有       选择t2.country_code,t2.freq       来自calls_at_one xx_country_code_frequency t2   )   group by country_code;'`

我尝试在WebSQL上运行它。

0 个答案:

没有答案