任何人都可以幫我解決這個錯誤嗎?SQL查詢中的令牌錯誤
解析查詢時出錯。 [令牌行號= 1,令牌行偏移= 628,令牌在錯誤=數據]
private DateTime data()
{
DateTime datasot = DateTime.Now;
string d = datasot.ToString("M/d/yyyy");
DateTime dd = DateTime.Parse(d);
return dd;
}
string komanda = "UPDATE ditari SET [email protected], [email protected], [email protected]," +
"[email protected], [email protected], [email protected], [email protected]," +
"[email protected], [email protected], [email protected], [email protected]," +
"[email protected], [email protected], [email protected], [email protected]," +
"[email protected],[email protected],[email protected]," +
"[email protected], [email protected]" +
"WHERE data='"+data()+"'";
SqlCeConnection sq = new SqlCeConnection(Connection.connectionstring);
SqlCeCommand sc = new SqlCeCommand(komanda, sq);
try
{
sq.Open();
sc.Parameters.AddWithValue(@"id", Qasja.ID);
sc.Parameters.AddWithValue(@"namazisabahut", cbnamazisabahut.SelectedItem.ToString());
sc.Parameters.AddWithValue(@"namazidrekes", cbnamazidrekes.SelectedItem.ToString());
sc.Parameters.AddWithValue(@"namaziikindise", cbnamaziikindise.SelectedItem.ToString());
sc.Parameters.AddWithValue(@"namaziakshamit", cbnamaziakshamit.SelectedItem.ToString());
sc.Parameters.AddWithValue(@"namazijacise", cbnamazijacise.SelectedItem.ToString());
sc.Parameters.AddWithValue(@"dymbedhjeterekatesunnet", chkdymbedhjetrekatesunnet.CheckState);
sc.Parameters.AddWithValue(@"namaznate", chkNamazNate.CheckState);
sc.Parameters.AddWithValue(@"leximikuranit", chkLeximiKuranit.CheckState);
sc.Parameters.AddWithValue(@"ndegjimikuranit", chkLeximiKuranit.CheckState);
sc.Parameters.AddWithValue(@"ndegjimidersit", chkNdegjimiDersit.CheckState);
sc.Parameters.AddWithValue(@"mekatet", txtpershkrimimekatit.Text);
sc.Parameters.AddWithValue(@"mesimilenda", txtmesimilenda.Text);
sc.Parameters.AddWithValue(@"mesimior", nud_saorkenimsu.Value);
sc.Parameters.AddWithValue(@"mesimipershkrimi", txtpershkrimiMsimit.Text);
sc.Parameters.AddWithValue(@"akeniqenepune", chkAkeniqenepune.CheckState);
sc.Parameters.AddWithValue(@"punepershkrimi", txtPershkrimiPuna.Text);
sc.Parameters.AddWithValue(@"pershkrimishkurterditor", richtextPershkrimiDitor.Text);
sc.Parameters.AddWithValue(@"dhikrimengjesitdhembremjes", cbdhikrimengjesitmbremjes.SelectedItem.ToString());
sc.Parameters.AddWithValue(@"estagfirullah", chkEstigfar.CheckState);
sc.Parameters.AddWithValue(@"salavatet", chksalavatet.CheckState);
sc.ExecuteNonQuery();
sc.Dispose();
sq.Close();
檢查字符串科曼達產生有效的SQL –