V
VB Programmer
When I run an SQL statement with ADO.NET it gives me this error:
System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32
hr)
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at DMSI.SqlHelper.ExecuteSql(String strSql, String strCnnString) in
c:\inetpub\wwwroot\DMSI\SqlHelper.vb:line 9
When I copy/paste the SQL directly into an Access query and run it it runs
PERFECT.
Here's the SQL:
INSERT INTO
Employees(EmployeeId,TitleId,FirstName,MiddleInitial,LastName,Address,City,S
tate,Zip,CellPhone,Fax,EmailAddress,UserName,Password,RegionalDirectorId)
VALUES(8,3,'c','c','c','c','c','c','c','c','c','c','c','c',6);
Ideas?
Thanks!
System.Data.OleDb.OleDbException: Syntax error in INSERT INTO statement.
at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(Int32
hr)
at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at DMSI.SqlHelper.ExecuteSql(String strSql, String strCnnString) in
c:\inetpub\wwwroot\DMSI\SqlHelper.vb:line 9
When I copy/paste the SQL directly into an Access query and run it it runs
PERFECT.
Here's the SQL:
INSERT INTO
Employees(EmployeeId,TitleId,FirstName,MiddleInitial,LastName,Address,City,S
tate,Zip,CellPhone,Fax,EmailAddress,UserName,Password,RegionalDirectorId)
VALUES(8,3,'c','c','c','c','c','c','c','c','c','c','c','c',6);
Ideas?
Thanks!