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

        
        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()



        Panel2.Visible = True


    End If

    Next


End Sub






How do I pass "strMCICardID" into the SP? Is thte above correct?

Thanks!






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/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/
 


Reply via email to