c#中提示sql异常,第一行附近有语法错误,请高手指点
stringsql=String.Format("updataIncomesetkinngaku={0},fucyuu='{1}',kouumuku='{2}'where...
string sql = String.Format("updata Income set kinngaku={0},fucyuu='{1}',kouumuku='{2}' where flg={3}", Convert.ToDecimal(item[5]), item[6], item[4], item[1]);
SqlCommand sc = new SqlCommand(sql, DBHelper.connection);
DBHelper.connection.Open();
if (sc.ExecuteNonQuery() < 1 )
{
MessageBox.Show("修改失败", "提示");
return false;
}
else
{
MessageBox.Show("修改成功", "提示");
DBHelper.connection.Close();
return true;
} 展开
SqlCommand sc = new SqlCommand(sql, DBHelper.connection);
DBHelper.connection.Open();
if (sc.ExecuteNonQuery() < 1 )
{
MessageBox.Show("修改失败", "提示");
return false;
}
else
{
MessageBox.Show("修改成功", "提示");
DBHelper.connection.Close();
return true;
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询