Are there more input parameters than the one you're adding?
On 11/18/05, sas0riza <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have the following:
>
> Sub Select_Click(sender As Object, e As EventArgs)
>
> Panel1.Visible = False
>
>
> Dim myDataGridItem As DataGridItem
>
> Dim chkSelected As System.Web.UI.WebControls.CheckBox
>
> Dim strMCICardID As String
>
>
> For Each myDataGridItem In searchresults.Items
>
> chkSelected = myDataGridItem.FindControl("chkSelection")
>
> If chkSelected.Checked Then
>
> strMCICardID = CType(myDataGridItem.FindControl
> ("lblMCICardID"), Label).Text
>
>
>
> Panel2.Visible = True
>
>
>
> End Sub
>
>
> Sub Submit_Click(sender As Object, e As EventArgs)
> If Page.IsValid then
>
>
> Dim objConn As SqlConnection
> Dim objSQLCommand As SqlCommand
> Dim objParam As SqlParameter
> Dim boolInsertOK As Boolean = False
> Dim intReturnError as Integer
>
> 'Set up our connection object and SQL command
> object.
> objConn = New SqlConnection("_")
> objSQLCommand = New SqlCommand("spLostCard",
> objConn)
>
> 'Set the stored procedure.
> objSQLCommand.CommandType =
> CommandType.StoredProcedure
>
>
>
> 'Add input parameters...
> objParam = objSQLCommand.Parameters.Add
> ("@CustomerUID", strMCICardID)
>
>
> 'Add our ouput parameters...
> objParam = objSQLCommand.Parameters.Add
> ("@Error_Code", SqlDbType.Int)
> objParam.Direction = ParameterDirection.Output
>
> 'Open the db connection & Execute Command.
> objConn.Open()
> objSQLCommand.ExecuteNonQuery()
>
> 'Get the return values.
> If Not IsDBNull(objSQLCommand.Parameters
> ("@Error_Code").Value) Then
> intReturnError = (objSQLCommand.Parameters
> ("@Error_Code").Value)
> End If
>
> Response.Write ("<BR>return error code = " &
> intReturnError)
>
> 'Check the error.
> If intReturnError = 0 Then
> 'No errors. Set our confirm msg.
> boolInsertOK = True
> Else
> 'We had an error. Set our error msg.
> boolInsertOK = False
> End If
>
> 'Close the DB connection.
> objConn.Close()
>
>
> End If
>
>
> End Sub
>
>
>
>
> However, I am getting this error: Procedure 'spLostCard' expects
> parameter '@CustomerUID', which was not supplied
>
> Thanks!
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~->
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/