Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help troubleshooting SQL Stored Proc. how to show values in vb code

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
0
36
US
I have this VB code that runs a Stored Procedure. It is not doing anything but is not returning any error either. So I don't know what's not working. is there a way to see inside the parameters or to debug.print something?
If I run the SP in SSMS it works fine. so the SP seems to be OK.
Code:
        Try
            cnn.Open()
            With cmd
                .Connection = cnn
                .CommandText = "sp_SOW_ManagerApproveTime"
                .CommandType = CommandType.StoredProcedure
                .Parameters.AddWithValue("WeekEndDate", Me.txtWeekEndingDate.Text)
                .Parameters(0).SqlDbType = SqlDbType.Date
                .Parameters.AddWithValue("Manager", Me.lblManagerName.Text)
                .Parameters(1).SqlDbType = SqlDbType.Char
                .Parameters.AddWithValue("ResourceLastName", TheFname)
                .Parameters(2).SqlDbType = SqlDbType.Char
                .Parameters.AddWithValue("ResourceFirstName", TheLname)
                .Parameters(3).SqlDbType = SqlDbType.Char
                ' execute Sp
                RetVal = .ExecuteScalar

            End With

TIA

DougP
 
Never mind I see that I am passing the first name to the last name parameter and Visa Versa
Dooh
Code:
.Parameters.AddWithValue("ResourceLastName", TheFname)

DougP
 
Just an FYI. If you do need to see what is being run, you can use SQL Server Management Studio.. Start SQL profiler, and you will see the SP being called, with what parameters, and parameter values.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top