Someone can help me???
I trying to make a app using C# and ODBC iSeries to insert some XMLs informations into AS400. So, I have a error that I can't undertand and resolve.
*System.Data.Odbc.OdbcException (0x80131937): ERROR [42000] [IBM][iSeries Access ODBC Driver][DB2 UDB]SQL0104 - Token ; was not valid. Valid tokens: . at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) at System.Data.Odbc.OdbcCommand.ExecuteNonQuery() at XmlTransport.AS400Connect.AS400Insert(String strInsert) in J:\Documents\Projetos\Projetos VS2010\XmlTransport\XmlTransport\AS400Connect.cs:line 48*
The line 48 it's my ExecuteNonQuerry command:
OdbcConnection conn = new OdbcConnection("Dsn=LA400PC;system=LA400PC;uid=SOMEUSER;pwd=SOMEPWD;dbq=QGPL;dftpkglib=QGPL;languageid=ENU;pkg=QGPL/DEFAULT(IBM),2,0,1,0,512;translate=1;signon=1");
conn.Open();
try
{
OdbcCommand insertComand = new OdbcCommand(strInsert, conn);
insertComand.ExecuteNonQuery();
}
And I'm trying to insrte this string:
INSERT INTO ZSA3837.CONFXMLH VALUES ('26111160500246001479550010000564091205644070', '1', '56409', 20111116, 60500246001479, 97422620000150, 122929.08, 14751.50, 200743.19, 19374.84, 122929.08, 18439.36, 160743.28);
I'm trying many thing but can't make works... can anyone help me ??? Thanks
I've had pretty good luck with this. I think DSN is PC specific so it's probably balking at that.
User contributions licensed under CC BY-SA 3.0