Anyone know why I'm always getting 0 returned? My stored procedure
returns -1.
Dim iErrorCode As Int32
iErrorCode = Convert.ToInt32 (SqlHelper.Exec uteScalar(AppVa rs.strConn, _
"gpUpdateMember ", _
Convert.ToInt32 (lblMember_id.T ext), _
-snip-
-Max 6 3502
ExecuteScalar: Executes the query, and returns the first column of the
first row in the result set returned by the query. Extra columns or rows are
ignored.
What were you expecting back?
"Max" <no****@notvali d.com> wrote in message
news:uA******** ******@tk2msftn gp13.phx.gbl... Anyone know why I'm always getting 0 returned? My stored procedure returns -1.
Dim iErrorCode As Int32 iErrorCode = Convert.ToInt32 (SqlHelper.Exec uteScalar(AppVa rs.strConn, _ "gpUpdateMember ", _ Convert.ToInt32 (lblMember_id.T ext), _ -snip-
-Max
In my stored proc I have return @errorcode or return -1
I thought ExecuteScalar was for getting a single value...
"Scott M." <s-***@nospam.nosp am> wrote in message
news:uT******** ******@tk2msftn gp13.phx.gbl... ExecuteScalar: Executes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored.
What were you expecting back?
"Max" <no****@notvali d.com> wrote in message news:uA******** ******@tk2msftn gp13.phx.gbl... Anyone know why I'm always getting 0 returned? My stored procedure returns -1.
Dim iErrorCode As Int32 iErrorCode = Convert.ToInt32 (SqlHelper.Exec uteScalar(AppVa rs.strConn, _ "gpUpdateMember ", _ Convert.ToInt32 (lblMember_id.T ext), _ -snip-
-Max
To get a Return value you have to use a parameter...
cmd.Parameters. Add("RETURN_VAL UE", SqlDbType.Int). Direction =
ParameterDirect ion.ReturnValue
....
Dim retval as integer = CInt(cmd.Parame ters("RETURN_VA LUE").Value)
HTH,
Greg
"Max" <no****@notvali d.com> wrote in message
news:eh******** ******@TK2MSFTN GP09.phx.gbl... In my stored proc I have return @errorcode or return -1
I thought ExecuteScalar was for getting a single value... "Scott M." <s-***@nospam.nosp am> wrote in message news:uT******** ******@tk2msftn gp13.phx.gbl... ExecuteScalar: Executes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored.
What were you expecting back?
"Max" <no****@notvali d.com> wrote in message news:uA******** ******@tk2msftn gp13.phx.gbl... Anyone know why I'm always getting 0 returned? My stored procedure returns -1.
Dim iErrorCode As Int32 iErrorCode = Convert.ToInt32 (SqlHelper.Exec uteScalar(AppVa rs.strConn, _ "gpUpdateMember ", _ Convert.ToInt32 (lblMember_id.T ext), _ -snip-
-Max
Thanks I know that works, but principally speaking I swore I could return a
value with ExecuteScalar. I think it's my return statement in the stored
procedure...
something like...
RETURN SELECT @errorcode
or..
RETURN SELECT myvar = @errorcode
Something that returns a recordset, but it doesn't...
Thanks for your guys help!
"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:eb******** ******@TK2MSFTN GP15.phx.gbl... To get a Return value you have to use a parameter...
cmd.Parameters. Add("RETURN_VAL UE", SqlDbType.Int). Direction = ParameterDirect ion.ReturnValue ... Dim retval as integer = CInt(cmd.Parame ters("RETURN_VA LUE").Value)
HTH, Greg
"Max" <no****@notvali d.com> wrote in message news:eh******** ******@TK2MSFTN GP09.phx.gbl... In my stored proc I have return @errorcode or return -1
I thought ExecuteScalar was for getting a single value... "Scott M." <s-***@nospam.nosp am> wrote in message news:uT******** ******@tk2msftn gp13.phx.gbl... ExecuteScalar: Executes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored.
What were you expecting back?
"Max" <no****@notvali d.com> wrote in message news:uA******** ******@tk2msftn gp13.phx.gbl... Anyone know why I'm always getting 0 returned? My stored procedure returns -1.
Dim iErrorCode As Int32 iErrorCode = Convert.ToInt32 (SqlHelper.Exec uteScalar(AppVa rs.strConn, _ "gpUpdateMember ", _ Convert.ToInt32 (lblMember_id.T ext), _ -snip-
-Max
You almost got it, just drop the RETURN part
SELECT @errorcode
Greg
"Max" <no****@notvali d.com> wrote in message
news:ei******** *******@TK2MSFT NGP11.phx.gbl.. . Thanks I know that works, but principally speaking I swore I could return a value with ExecuteScalar. I think it's my return statement in the stored procedure...
something like... RETURN SELECT @errorcode or.. RETURN SELECT myvar = @errorcode
Something that returns a recordset, but it doesn't...
Thanks for your guys help! "Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message news:eb******** ******@TK2MSFTN GP15.phx.gbl... To get a Return value you have to use a parameter...
cmd.Parameters. Add("RETURN_VAL UE", SqlDbType.Int). Direction = ParameterDirect ion.ReturnValue ... Dim retval as integer = CInt(cmd.Parame ters("RETURN_VA LUE").Value)
HTH, Greg
"Max" <no****@notvali d.com> wrote in message news:eh******** ******@TK2MSFTN GP09.phx.gbl... In my stored proc I have return @errorcode or return -1
I thought ExecuteScalar was for getting a single value... "Scott M." <s-***@nospam.nosp am> wrote in message news:uT******** ******@tk2msftn gp13.phx.gbl... ExecuteScalar: Executes the query, and returns the first column of the first row in the result set returned by the query. Extra columns or rows are ignored.
What were you expecting back?
"Max" <no****@notvali d.com> wrote in message news:uA******** ******@tk2msftn gp13.phx.gbl... > Anyone know why I'm always getting 0 returned? My stored procedure > returns -1. > > Dim iErrorCode As Int32 > iErrorCode = Convert.ToInt32 (SqlHelper.Exec uteScalar(AppVa rs.strConn, > _ > "gpUpdateMember ", _ > Convert.ToInt32 (lblMember_id.T ext), _ > -snip- > > -Max >
I think you're right! lol! This tells me I need to get a book on tsql
instead of relying on samples and quick start guides.
Thanks!
-Max
"Greg Burns" <greg_burns@DON T_SPAM_ME_hotma il.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. .. You almost got it, just drop the RETURN part
SELECT @errorcode
Greg
"Max" <no****@notvali d.com> wrote in message news:ei******** *******@TK2MSFT NGP11.phx.gbl.. . Thanks I know that works, but principally speaking I swore I could return a value with ExecuteScalar. I think it's my return statement in the stored procedure...
something like... RETURN SELECT @errorcode or.. RETURN SELECT myvar = @errorcode
Something that returns a recordset, but it doesn't...
Thanks for your guys help! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Punit |
last post by:
Hi,
Could someone please suggest where I am going wrong... Iam using MSXML
3.0 and VC++ but i end up getting blank response XML
try
{
hr = m_PSiebelDocument.CreateInstance(MSXML2::CLSID_DOMDocument);
if(SUCCEEDED(hr))
{
|
by: JDC |
last post by:
Hi all,
Is there a recommended way (i.e. not a bodge) to get a GridView to
always display decimal numbers using a dot as the decimal separator,
regardless of the locale the user is viewing the page from? (I.e.
3.1415 not 3,1415)
Thanks in advance, Jeremy
|
by: pm1ccc |
last post by:
Hi,
I have written following code and not getting back values in the same form ( i have used phpself)
<?php
$Fname = $_POST;
$Lname = $_POST;
$gender = $_POST;
$food = $_POST;
$quote = $_POST;
|
by: simbarashe |
last post by:
Hie
could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as follows:
The code below is for the first page:session_start is in line 3
<link href="css/jobSheet.css" rel="stylesheet" type="text/css" />
session_start();
|
by: =?Utf-8?B?R3lhbmVuZHJh?= |
last post by:
I am using Ajax control(Update Panel) in my web page(ASP.Net 2.0) and putting
Report Viewer(Sql Server Reporting Services 2005) Control in it.
When I am displaying any report it is coming ,But Report Viewer Toolbar is
not working Ex Print Command Button and if I try to move to next page I am
getting error “The source of the report definition has not been specified “
“
| |
by: programmerboy |
last post by:
This questions is pretty easy, but let me ask since I wasn't able to figure it out.
why I am always getting the first value from DropDownList when I have
ddlStates.SelectedItem.Value;
Autopostback = false;
EnableViewState = true;
|
by: Chuck Anderson |
last post by:
I am trying to use ImageMagick to create thumbnails on the fly - without
having to save the image to a file.
I have gotten it to work by using passthru($cmd, $retval), but I want to
use something else that will give me the complete output returned as a
string that I can convert to a GD lib image resource so I can verify the
operation worked before sending the Content-type header for the image.
This works:...
|
by: manoj9849967222 |
last post by:
Hi All
I have a great problem.
I have three tables one is "SALES" other one is "Purchase" & "Productid"
Now i want to get the closing stock out of it.
Say productid is 1.2 --------- Purchased---100 qty & Sales-----50 qty
1.3----------Purcahsed---300 qty & sales-----100 qty
1.2--------- Purcahsed--000 qty & sales-----20 qty
|
by: Christian Heimes |
last post by:
Grant Edwards wrote:
It's dangerous to mix streams and descriptors. Traditionally freopen()
is used to redirect a standard stream to a file:
http://www.gnu.org/software/libc/manual/html_mono/libc.html#Standard-Streams
— Function: FILE * freopen (const char *filename, const char *opentype,
FILE *stream)
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |