Home > Net >  C # using the oledb to excel has prompted INSERT into grammatical errors
C # using the oledb to excel has prompted INSERT into grammatical errors

Time:10-19

String strConnt=@ ". The Provider=Microsoft Jet. The OleDb. 4.0;" + "data source=" + _FilePath + @ "; Extended Properties='Excel 8.0; HDR=YES; IMEX=2 '";

_OLEdbConnt=new OleDbConnection (strConnt);
_OLEdbConnt. The Open ();

String STRSQL="INSERT INTO account [$] VALUES (1, 'the first team, 1,' wang2 xiao3 er4, 4,40,2,0,0,2,20,206.4,44,448.4, 98, 00108032500004470,)";

_OLECommand=new OleDbCommand (SQL, _OLEdbConnt);
Int iRet=_OLECommand. ExecuteNonQuery ();
Always prompt the INSERT INTO statement syntax errors, a great god answer genuflect is begged

CodePudding user response:

Ask god to reassure!!!!!!!!!!!!!!!

CodePudding user response:

00108032500004470 , ), "these are the two commas

CodePudding user response:

Problem solved, when inserts are not free value, value, if I have time to write a string in the form of a combined with single quotes, thank you
  •  Tags:  
  • C#
  • Related