I've got a SQL Server 2000 stored procedure called 'Requistions_add'
that takes a whole bunch of input parameters and one output parameter:

CREATE  procedure Requistions_add
(       @RequistionId                   int             OUTPUT
,       @CreatedTs                      datetime        
,       @PersonId_Creator               smallint
,       @OrganizationId_Charge          smallint
,       @OrganizationId_Install         smallint
,       @FacilityId_Install             smallint
,       @BusinessNeedDescr              varchar( 255 )
,       @ContactLastName                varchar( 255 )
,       @ContactFirstName               varchar( 255 )
,       @Phone_Contact                  varchar( 255 )
,       @Email_Contact                  varchar( 255 )
,       @PCScope                        varchar( 255 )
,       @PCName                         varchar( 255 )
,       @HelpDeskTicket                 varchar( 255 )
,       @InstallationInstructions       text
) 

[ etc ...]

The VB.NET code looks like this:

                Dim cmSaveReq As New SqlCommand
                cmSaveReq.Connection = cnDeliveryAndInstallation
                cmSaveReq.CommandType = CommandType.StoredProcedure
                cmSaveReq.CommandText = "dbo.Requistions_add"

                'set up output parameter
                Dim paramNewReqID As New SqlParameter
                paramNewReqID.ParameterName = "@RequistionId"
                paramNewReqID.SqlDbType = SqlDbType.Int
                paramNewReqID.Direction = ParameterDirection.ReturnValue
                cmSaveReq.Parameters.Add(paramNewReqID)

                cmSaveReq.Parameters.Add("@CreatedTs", Now)
                cmSaveReq.Parameters.Add("@PersonId_Creator", personID.Text)
                cmSaveReq.Parameters.Add("@OrganizationId_Charge", 
costCenterDeptCharged.Text)

[ some more input params added ]

                If cnDeliveryAndInstallation.State = ConnectionState.Closed Then
cnDeliveryAndInstallation.Open()
                Dim intNewReqID As Integer = cmSaveReq.ExecuteScalar

On that last line of ExecuteScalar - I get that error (see subject
line, please).  What is going on here?  I AM supplying it with the
parameter!

Any help would be more than appreciated!

Thanks,
Eliezer


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to