大家好,我希望有人能帮助我,我正在学习 c# 到目前为止,我已经编写了几个有用的程序,但是现在我被一个特定的问题难住了,我已经用谷歌搜索了我认为我需要的查询。这是我的代码
try
{
con.Open();
cmd = new SqlCommand("SELECT * from LMNormal", con);
cmd.CommandText = ("INSERT INTO LMNormal (upc,cert_code,description,cost,normal_price,pricemethod,groupprice,quantity,special_price,specialcost,specialpricemethod,specialgroupprice,specialquantity,start_date,end_date,pack,size,unitofmeasure) SELECT (upc,cert_code,description,cost,normal_price,pricemethod,groupprice,quantity,special_price,specialcost,specialpricemethod,specialgroupprice,specialquantity,start_date,end_date,pack,size,unitofmeasure) from products where (modified >= @now) and (advertised=@false)");
cmd.Parameters.AddWithValue("@now", now);
cmd.Parameters.AddWithValue("@false", selected);
cmd.Connection = con;
cmd.ExecuteNonQuery();
timer1.Start();
con.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
当程序执行时,它会捕获我的错误并在''附近说不正确的语法,我很难弄清楚这个逗号在哪里。
感谢您的任何意见