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
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
Comment