call command in asp.net

1355 pts.
Tags:
ASP.NET
how to code call command with parameter in asp.net with c#

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 5  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Which call command? What are you calling? A program on another system? A SQL stored proc? Something else? -- Tom
    125,585 pointsBadges:
    report
  • 9783444184
    sorry i m calling CL program .. cmd.CommandType = CommandType.Text; cmd.CommandText = "CALL AMITS.TST2(@rtnmsg @amount)";but showing SQL0104: Token @RTNMSG was not valid. Valid tokens: :.Cause . . . . . :   A syntax error was detected at token @RTNMSG.  Token @RTNMSG 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 @RTNMSG. 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.
    1,355 pointsBadges:
    report
  • TomLiotta
    Since it's a SQL error, it looks like you're calling a SQL stored proc. If the CL program isn't registered as a stored proc, you can't use a SQL CALL statement to call it. (In SQL, it's a CALL statement; not a CALL command. They are different.) Are you intending to use SQL to do this? -- Tom
    125,585 pointsBadges:
    report
  • carlosdl
    You can use commands to execute SQL statements or to call stored procedures.  If the "program" you are trying to execute doesn't fall into one of those categories, you will not be able to execute it that way.  If it is a stored procedure, then you must use a CommandType of 'StoredProcedure', and the CommandText must contain the name of the stored procedure only. 
    68,525 pointsBadges:
    report
  • TomLiotta
    ...you will not be able to execute it that way.   Technically, if the SQL CALL only has input parameters, you can use it to call any program that you have authority to call. (This might be more restricted on i 6.1 or later. I haven't done recent testing.) DB2 for i will process the CALL as if the program was registered as a stored procedure.   It looked as if parms were ouput or in/out in this case. But even if they weren't, the intention of the CALL should be clear in the question if we're to give appropriate help.   Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following