Sql不接受' .example'命令c#

时间:2016-08-04 06:07:23

标签: c# sql-server

我的sql命令:

INSERT INTO LOGS(EventID,Version,Level_,Task,Opcode,Keywords,EventRecordID,Correlation,ThreadID,ProcessID,Channel,Computer,Security)
VALUES 
(4624,0,0,12544,0,0x8020000000000000,911588,null,704,608,Security,ncelik.mst.bbb@mail.com.tr,null)

当我在visual studio中执行代码时 错误代码是:

  

System.Data.SqlClient.SqlException(0x80131904):语法不正确   ' MST&#39 ;. at system.Data.SqlClient.SqlConnection.OnError(SqlException,   Boolean breakConnection i Action 1 weaponCloseInAction)    我不知道它是什么

1 个答案:

答案 0 :(得分:1)

如果ncelik.mst.bbb@mail.com.tr是一个字符串,则必须用单引号括起来,如:

INSERT INTO LOGS(EventID,Version,Level_,Task,Opcode,Keywords,EventRecordID,Correlation,ThreadID,ProcessID,Channel,Computer,Security)
VALUES 
(4624,0,0,12544,0,0x8020000000000000,911588,null,704,608,Security,'ncelik.mst.bbb@mail.com.tr',null)