473,402 Members | 2,046 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,402 software developers and data experts.

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.OperatorLogon"
STR_SQLCOMMAND.CommandType = CommandType.StoredProcedure
STR_SQLCOMMAND.CommandTimeout = 30
With STR_SQLCOMMAND
' set the query commands
.CommandText = "BossData.dbo.OperatorLogon"
.CommandType = CommandType.StoredProcedure
.CommandTimeout = 30

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

For Counter = 0 To Err.Errors.Count - 1
errorMessages += "Message " &
Err.Errors(Counter).Message & ControlChars.NewLine
Next
Console.WriteLine(errorMessages)
End Try
End With
'read the results
While STR_SQLREADER.Read()
'Obtain values from each row here...
Console.WriteLine(CStr(STR_SQLREADER(0)))
' set the function return
LogonUsers = CInt(STR_SQLREADER(0))
End While
' clearup
STR_SQLREADER.Close()
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 1042
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*********@discussions.microsoft.com> schreef in bericht
news:1B**********************************@microsof t.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.OperatorLogon"
STR_SQLCOMMAND.CommandType = CommandType.StoredProcedure
STR_SQLCOMMAND.CommandTimeout = 30
With STR_SQLCOMMAND
' set the query commands
.CommandText = "BossData.dbo.OperatorLogon"
.CommandType = CommandType.StoredProcedure
.CommandTimeout = 30

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

For Counter = 0 To Err.Errors.Count - 1
errorMessages += "Message " &
Err.Errors(Counter).Message & ControlChars.NewLine
Next
Console.WriteLine(errorMessages)
End Try
End With
'read the results
While STR_SQLREADER.Read()
'Obtain values from each row here...
Console.WriteLine(CStr(STR_SQLREADER(0)))
' set the function return
LogonUsers = CInt(STR_SQLREADER(0))
End While
' clearup
STR_SQLREADER.Close()
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
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...
4
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...
0
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...
5
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...
2
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...
14
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,...
0
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...
2
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...
0
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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,...

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.