473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Return Values and SqlHelper

Does anyone have an example of getting a return value back from a
stored proc using the SqlHelper data block? This should be so easy!

Here is my stored proc:
CREATE PROCEDURE AddEmployee
(
@SessionID varchar(24),
@EmployeeID varchar(6)
)
AS
IF (SELECT COUNT(*) FROM Employees WHERE EmployeeID = @EmployeeID) = 0

BEGIN

INSERT INTO Employees
(
SessionID,
EmployeeID

)
VALUES
(
@SessionID,
@EmployeeID
)

RETURN 1

END

ELSE

RETURN 0
GO
Thanks

Nov 19 '05 #1
2 1087
Havnt used SqlHelper block but im assuming its a wrappeter over the
existing ado.net architecture. If there is a function to add Parameters
to a command, then you can create a command of type int and set its
direction to ReturnValue. That should get the return value back from
the database.

Nov 19 '05 #2
Oops sorry... its create a parameter an not command.

My bad :P

NuTcAsE

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rajesh Madhra | last post by:
Hi everybody I just solved my probem about creating my own assemblies by using the command line vbc /nologo /t:library /out:MyClass.dll ... MyClass.vb with your help. But I still cannot make...
3
by: Brian | last post by:
I am trying to pass a null value into a stored procedure so that it can save the data. I am using Microsoft's SQLHelper dll to do this. My example code is below. How do I pass in a null value...
3
by: Mark Tait | last post by:
Hi - I want to query a database to return just one record: ..select id, parentid, question, answer from tblquestions where id = @id).. read the fields returned from that record into variables:...
0
by: Rajesh Kumar | last post by:
Hi Gregory Thanks for your answer. I did not see any attached file so I copied your text into a text file and named it compiler.bat Checked the wrapped lines and runned the file. It said Dataset,...
0
by: Rajesh Madhra | last post by:
Hi Gregory Thanks for your answer. I did not see any attached file so I copied your text into a text file and named it compiler.bat Checked the wrapped lines and runned the file. It said Dataset,...
7
by: Neven Klofutar | last post by:
Hi, I have a problem with SqlHelper.ExecuteScalar ... When I try to execute SqlHelper.ExecuteScalar I get this message: "System.InvalidCastException: Object must implement IConvertible.". ...
0
by: Tim::.. | last post by:
Can someone tell me how you change this code for an Oledb connection rather than SQL Server. The code currently uses Microsoft.Data.Access.Application.Block and the SQLHelper object... I need to...
4
by: John F | last post by:
Hello All, What is the consensus on using sqlhelper or not using sqlhelper when calling stored procedures? We're trying to go with a standard for our projects and personally I prefer not...
1
by: iquttaineh | last post by:
Hi, I have a stored procedure that executed in SQL Server 2000 that returns a decimal SUM value, the stored procedure executed successfully in Query Analyzer and returns the correct value, but when...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.