2014-01-22 2 views
-2

누구든지이 오류를 해결할 수 있습니까?SQL 쿼리의 토큰 오류

쿼리를 구문 분석하는 동안 오류가 발생했습니다.

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(); 
+1

체크 문자열 komanda가 유효한 SQL –

답변

2

전에 누락 공간이 [토큰 행 번호 = 1, 토큰 라인 오류 = 데이터 = 628, 토큰 오프셋]를 "WHERE"조회한다.

+0

빠른 방법으로 생산이 도움말을 볼 것이

"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()+"'"; 

같이 변경해야 오류 메시지를 읽는 것이 좋습니다. 쿼리의 값을보고 라인 1 (한 줄만 표시됨)과 문자 628로 이동하면, 그것은 바로 뒤에 있습니다. 그래서 당신은 당신의 문제가이 곳과 멀지 않다는 것을 알고 있습니다. – krimog

0

당신은

그래서 쿼리는 그래서는 해석 할 수없는이

enter image description here

처럼 보이는 에 가까운 공간을 놓쳤다.

당신은 지금이

enter image description here

희망처럼 당신이