473,785 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Still Having SQL Stored Proc probs

ok this is getting far to technical for me now .. lol

thank you all for the help yesterday, however im still stumbling on one bit
... heres my code so far

Dim InputString() As String
Dim ReturnValue As Integer

InputString = Split(InputParm , ";")
' set the query commands
STR_SQLCOMMAND. CommandText = "BossData.dbo.O peratorLogon"
STR_SQLCOMMAND. CommandType = CommandType.Sto redProcedure
STR_SQLCOMMAND. CommandTimeout = 30
With STR_SQLCOMMAND
' set the query commands
.CommandText = "BossData.dbo.O peratorLogon"
.CommandType = CommandType.Sto redProcedure
.CommandTimeout = 30

' set the connection
.Connection = CON_BOSSCONNECT ION
' Set the 1st Parameter
.Parameters.Add ("@OperatorName ", SqlDbType.VarCh ar, 20).Value =
InputString(0)
' Set the 2nd Parameter
.Parameters.Add ("@OperatorPass word", SqlDbType.VarCh ar,
20).Value = InputString(1)
' Set the 3rd Parameter
.Parameters.Add ("@PasswordLife ", SqlDbType.VarCh ar, 3).Value =
InputString(2)
Try
' execute the query Use ExecuteScalar as only returning a
single value
STR_SQLREADER = .ExecuteReader( )
Catch Err As SqlClient.SqlEx ception
Dim errorMessages As String
Dim Counter As Integer

For Counter = 0 To Err.Errors.Coun t - 1
errorMessages += "Message " &
Err.Errors(Coun ter).Message & ControlChars.Ne wLine
Next
Console.WriteLi ne(errorMessage s)
End Try
End With
'read the results
While STR_SQLREADER.R ead()
'Obtain values from each row here...
Console.WriteLi ne(CStr(STR_SQL READER(0)))
' set the function return
LogonUsers = CInt(STR_SQLREA DER(0))
End While
' clearup
STR_SQLREADER.C lose()
Im getting this error message,

Message Procedure or Function 'OperatorLogon' expects parameter
'@ReturnValue', which was not supplied.

so my next question is in this case how do i
1. add the parameter @returnValue which is a type Integer and direction
Output from the stored proc
2. how do i read it ?

thanks again for your contuined help

Jun 14 '06 #1
1 1064
Peter,

I don't see it in your code, therefore you have to look in your SP what for
'@ReturnValue' is expected.

I assume that the SP is just not right in this case.

Cor

"Peter Newman" <Pe*********@di scussions.micro soft.com> schreef in bericht
news:1B******** *************** ***********@mic rosoft.com...
ok this is getting far to technical for me now .. lol

thank you all for the help yesterday, however im still stumbling on one
bit
.. heres my code so far

Dim InputString() As String
Dim ReturnValue As Integer

InputString = Split(InputParm , ";")
' set the query commands
STR_SQLCOMMAND. CommandText = "BossData.dbo.O peratorLogon"
STR_SQLCOMMAND. CommandType = CommandType.Sto redProcedure
STR_SQLCOMMAND. CommandTimeout = 30
With STR_SQLCOMMAND
' set the query commands
.CommandText = "BossData.dbo.O peratorLogon"
.CommandType = CommandType.Sto redProcedure
.CommandTimeout = 30

' set the connection
.Connection = CON_BOSSCONNECT ION
' Set the 1st Parameter
.Parameters.Add ("@OperatorName ", SqlDbType.VarCh ar, 20).Value =
InputString(0)
' Set the 2nd Parameter
.Parameters.Add ("@OperatorPass word", SqlDbType.VarCh ar,
20).Value = InputString(1)
' Set the 3rd Parameter
.Parameters.Add ("@PasswordLife ", SqlDbType.VarCh ar, 3).Value =
InputString(2)
Try
' execute the query Use ExecuteScalar as only returning a
single value
STR_SQLREADER = .ExecuteReader( )
Catch Err As SqlClient.SqlEx ception
Dim errorMessages As String
Dim Counter As Integer

For Counter = 0 To Err.Errors.Coun t - 1
errorMessages += "Message " &
Err.Errors(Coun ter).Message & ControlChars.Ne wLine
Next
Console.WriteLi ne(errorMessage s)
End Try
End With
'read the results
While STR_SQLREADER.R ead()
'Obtain values from each row here...
Console.WriteLi ne(CStr(STR_SQL READER(0)))
' set the function return
LogonUsers = CInt(STR_SQLREA DER(0))
End While
' clearup
STR_SQLREADER.C lose()
Im getting this error message,

Message Procedure or Function 'OperatorLogon' expects parameter
'@ReturnValue', which was not supplied.

so my next question is in this case how do i
1. add the parameter @returnValue which is a type Integer and direction
Output from the stored proc
2. how do i read it ?

thanks again for your contuined help

Jun 14 '06 #2

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

Similar topics

2
28068
by: June Moore | last post by:
Hi all, I have a stored procedure that return a resultset e.g. stored proc: get_employee_details select emp_id, emp_name, emp_salary, emp_position from empoloyee I would like to write another stored procedure that executes the above stored procedure - returning the same number of records but it will only show 2 columns
4
4405
by: Nyul | last post by:
Gurus, I have a verb big problem which I'm unable to explain. We have a DB2 V6.1.0 on AIX 4.3 I want to make a C stored procedure which at the end will be called by a PHP script. The development server was an UDB V6.1.0 on W2K. Everything went well. I was able to call the stored proc from C and from Delphi.
0
7148
by: Dave Sisk | last post by:
I've created a system or external trigger on an AS/400 file a.k.a DB2 table. (Note this is an external trigger defined with the ADDPFTRG CL command, not a SQL trigger defined with the CREATE TRIGGER statement.) I've also defined a SQL stored proc, and the trigger is set to call this SP. I've posted the simplified source below. I can manually call the stored proc, and the external trigger is created without any errors. However, when I do...
5
2142
by: Rhino | last post by:
This question relates to DB2 Version 6 on OS/390. Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to a sequential file? I am trying to debug a stored procedure. As far as I know, DB2 stored procedures cannot do terminal I/O on any operating system but I know that (Java) stored procedures in Windows/Linux/Unix can write to files and I have done this many times.
2
4281
by: Rhino | last post by:
I am getting an sqlcode of -927 when I execute SQL within a COBOL stored procedure in DB2 OS/390 Version 6 on OS/390. I have looked at the error message for that condition and tried everything I could think of to resolve the problem but nothing works. The stored proc is running in the DB2 Stored Procedures Address Space and both the client and the proc have DSNELI linked into their load modules. The client and proc are running in TSO via...
14
1835
by: Roy | last post by:
Apologies for the cross-post, but this truly is a two-sided question. Given the option of creating Looping statements within a stored proc of sql server or in the code-behind of an .net webpage, which would you choose and why? Reason I ask is I created a webpage which essentially runs through a litany of loops to determine which stored proc to kick off. This is written in the code-behind. It occurred to me that I could probably just...
0
2062
by: balaji krishna | last post by:
Hi, I need to handle the return set from COBOL stored procedure from my invoking Java program. I do not know, how many rows the stored proc SQL fetches.I have declared the cursor in that proc, but i don't know how to return the rows the cursor has opened and I don't know how to handle the return set from the proc in my java code. My main problem with that proc is that whether I can retun the result set from the proc without closing the cursor...
2
1144
by: Rob Eventine | last post by:
hi all, how does one go about changing the details in the aspnetdb dbase using the supplied stored procs? i am using vb as my language but i have no idea how to use them, how to call them or whatever.. i got the book sql in 24 hours and that made things worse as i really dont understand where the calls go? ANY help or code snippets would be a REAL big help..
0
1988
by: mirandacascade | last post by:
Questions toward the bottom of the post. Situation is this: 1) Access 97 2) SQL Server 2000 3) The Access app: a) sets up pass-thru query b) .SQL property of querydef is a string, the contents of which comprise the call to a stored proc
0
9483
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10157
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 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...
1
10096
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,...
0
9956
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8982
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, 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...
0
5386
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...
1
4055
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
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.