Solved

Update - using executenonquery

Posted on 2014-01-23
2
159 Views
Last Modified: 2014-02-06
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
Comment
Question by:VBdotnet2005
2 Comments
 
LVL 4

Expert Comment

by:ravikantninave
ID: 39804253
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
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 39804512
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now