Update executenonquery c#




















Add Comments. Thank you for the feedback. The comment is now awaiting moderation. You will be notified via email when the author replies to your comment. Please select a comment to reply. You can add your comment about this article using the form below. Make sure you provide a valid email address else you won't be notified when the author replies to your comment Please note that all comments are moderated and will be deleted if they are Not relavant to the article Spam Advertising campaigns or links to other sites Abusive content.

Please do not post code, scripts or snippets. Required Invalid Email Address. Security code:. Required Invalid security code. I declare, I accept the site's Privacy Policy. Add Comment. What our readers say. Error Details. I tried this stored procedure by entering the same values I captured from debugging. It was successful. What can be the possible error? Thanks a lot! Let's have a look at the documentation for ExecuteNonQuery :.

For all other types of statements, the return value is You're calling a stored procedure, which, in and of itself, is none of the 3 listed statements where a row count is returned. If you want to determine the value that was passed to a return statement within the stored procedure, you need to add another parameter to the command, and set its Direction property to ReturnValue the name you give to this parameter will be ignored. Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. ExecuteNonQuery returns -1 when execute the stored procedure Ask Question. Asked 9 years, 3 months ago. Active 6 years, 6 months ago. Viewed 34k times. I'm trying to execute stored procedure in Visual Studio. Its given below. StoredProcedure; cmd. Add " stuName", SqlDbType.

ToString ; cmd. Add " address", SqlDbType. Add " tel", SqlDbType. Add " etel", SqlDbType. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years ago. Active 10 years ago. Viewed 7k times. Connect To Database Request User Input New Value Send User Input to Database Text ; sqlCom. VarChar ; sqlCom. Parameters[" FieldVal"].

Parameters[" InputVal"]. Parameters[" CaseNoVal"]. ExecuteNonQuery ; MessageBox. Show intQuery. Improve this question. Add a comment. Active Oldest Votes.



0コメント

  • 1000 / 1000