?
Solved

Update - using executenonquery

Posted on 2014-01-23
2
Medium Priority
?
166 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 2000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

649 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