[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 168
  • Last Modified:

Update - using executenonquery

I have an update storeprocedure that return Yes if  all conditions are good, if not returns No. Now in code behind, do I use executenonquery ? I want to display to a user if update is success or not.
0
VBdotnet2005
Asked:
VBdotnet2005
1 Solution
 
ravikantninaveCommented:
Yes you can use executenonquery. Pass some output parameter in query and return value in that paramete.  Read the value if value is Yes/No show message
0
 
Carl TawnSystems and Integration DeveloperCommented:
It depends how the proc is returning the value. If you are using an output parameter then you can use ExecuteNonQuery(). If it returns a value with a SELECT then you will need to use ExecuteScalar() instead.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now