Solved

Update - using executenonquery

Posted on 2014-01-23
2
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

691 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