Return values from component - Novice Question 
Author Message
 Return values from component - Novice Question


I am trying to return 2 output parameters from SQL server via a / component, I have verified that the stored procedure is returning
the two values that I expect to see, however I am unsure of the syntax I
need to use in order to see it on the web form I can return one parameter
customerId I just don't know how to return both at the same time.

I have included the code below, if someone has any ideas I would be most


function call in webform code behind page-----
Dim LoginCustomer As shopsmart.Customers = New shopsmart.Customers()

Dim customerId As String =

Message.Text = customerId.ToString

Message1.Text = RetVal.ToString

Component code---

Public Function Login(ByVal email As String, ByVal password As String) As

' Create Instance of Connection and Command Object

Dim myConnection As SqlConnection = New

Dim myCommand As SqlCommand = New SqlCommand("CustomerLogin", myConnection)

' Mark the Command as a SPROC

myCommand.CommandType = CommandType.StoredProcedure

' Add Parameters to SPROC

SqlDbType.NVarChar, 300)

parameterEmail.Value = email


SqlDbType.NVarChar, 10)

parameterPassword.Value = password


SqlDbType.VarChar, 300)

parameterRetVal.Value = ParameterDirection.Output


SqlDbType.Int, 8)

parameterCustomerID.Direction = ParameterDirection.Output




Catch XcpInvOp As System.Exception





myConnection = Nothing

End Try

Dim customerId As Integer = CInt(parameterCustomerID.Value)

Dim RetVal As String = CStr(parameterRetVal.Value)

If customerId = 0 Then

Return Nothing

' Return RetVal

' Return customerId.ToString()


Return customerId.ToString()

Return RetVal.ToString()

End If

End Function

Thu, 01 Dec 2005 09:44:07 GMT  
 Return values from component - Novice Question
Your clock is wrong!

Herfried K. Wagner
MVP VB Classic, VB .NET

Thu, 01 Dec 2005 06:47:43 GMT  
 [ 2 post ] 

 Relevant Pages 

1. Unable to return ouput parameters to component - novice question

2. problem using component with asp page -- result of function not returned, instead original value returned

3. Main report value<-pass/return->subReport values (ActiveX Designer Component 6.0)

4. Returning Dataset to ASP.NET from .NET Component / Business Object Serialization

5. VB.NET Function Return Values

6. How to test for a NULL return value from FindByValue in

7. Returning Values from SP with VB.NET

8. Returning values from SP with VB.NET

9. Question from VBA novice re True and False values in VBA code for Word97

10. How To: Return more than a single value from Script Component methods - accessing thru VC++

11. vb .net novice please help

12. debugging upgraded component in


Powered by phpBB® Forum Software