Click here to Skip to main content
15,900,461 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C#
objCmd.CommandType = CommandType.Text
objCmd.CommandText = "{{CALL amits.tst2 (? ?)}}"
Execute iSeries non-stored procedure program call
objCmd.ExecuteNonQuery()


for above vb code is working fine
but for c# is not working please suggest

C#
cmd.CommandType = CommandType.Text;
cmd.CommandText = "CALL AMITS.TST2()";
cmd.ExecuteNonQuery();


it given error ......

SQL0104: Token ? was not valid. Valid tokens: ) ,. Cause . . . . . : A syntax error was detected at token ?. Token ? is not a valid token. A partial list of valid tokens is ) ,. This list assumes that the statement is correct up to the token. The error may be earlier in the statement, but the syntax of the statement appears to be valid up to this point. Recovery . . . : Do one or more of the following and try the request again: -- Verify the SQL statement in the area of the token ?. Correct the statement. The error could be a missing comma or quotation mark, it could be a misspelled word, or it could be related to the order of clauses. -- If the error token is <end-of-statement>, correct the SQL statement because it does not end with a valid clause.
Posted
Updated 28-Aug-12 2:59am
v2

1 solution

(?) means that the SQL expects a parameter in the query.

There aren´t differences between vb.net and c# depends on What language do you like or use. C# is for develeloper that have some experience with java, c++, pascal. VB.NET is Basic :)

So, hope it helps :)
 
Share this answer
 
v2
Comments
9783444184 29-Aug-12 1:56am    
so how to resolve it coz i am new in both languages

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900