I am trying to debug my code, which involves a simple webservice that passes parameters to a data class, which calls a stored proc, and returns one row of record. I am not getting any error messages, but I am not getting any records back either.
My webservice code is:
<WebMethod()> _
Public Function GetDataValues(ByVal AutoVIN As String, ByVal OrderID As String, ByVal StatusCode As String, ByVal DivisionID As String) As String
Dim oGetHeaderValue As New clsGetHeaderValue
Dim GetHeaderValues As String = ""
Dim strAutoVIN = Trim(AutoVIN)
Dim strOrderID = Trim(OrderID)
Dim strStatusCode = Trim(StatusCode)
Dim strDivisionID = Trim(DivisionID)
Try
'Validate user entries if they are the correct length;
If Not IsNumeric(strAutoVIN) Or Len(Trim(strAutoVIN)) <> 3 Then
Throw New SoapException("Invalid Auto VI Number", SoapException.ClientFaultCode)
End If
'OrderID could be 12 digits in length
If Not IsNumeric(strOrderID) Then
Throw New SoapException("Invalid Order ID", SoapException.ClientFaultCode)
End If
'************************Verify if the order exists "Order Number not in requested status" in table Auto.orderHeader
'************************Validate entries against db table;
'Call Stored Proc and pass parameters;
Dim retDataSet As Data.DataSet
retDataSet = oGetHeaderValue.GetHeaderValue(strAutoVIN, strOrderID, strStatusCode, strDivisionID)
GetHeaderValues = retDataSet.ToString()
Return GetHeaderValues
Catch ex As Exception
Return "<ERR>" & ex.Message.ToString & "</ERR>"
End Try
End Function
My database class code is:
Public Function GetGetHeaderValue(ByVal sAutoVIN As String, ByVal sOrderID As String, ByVal sStatusCode As String, ByVal sDivisionID As String) As DataSet
Dim sqlDA As New SqlDataAdapter
Dim ds As New DataSet
Dim sqlcmd As New SqlCommand
Dim conn As New SqlConnection(strCN_Auto)
sqlDA = New SqlDataAdapter("uspExportOrders", conn)
sqlDA.SelectCommand.CommandType = CommandType.StoredProcedure
sqlDA.SelectCommand.Parameters.Add(New SqlParameter("@AutoVIN", SqlDbType.VarChar, 3))
sqlDA.SelectCommand.Parameters("@AutoVIN").Value = sAutoVIN
sqlDA.SelectCommand.Parameters.Add(New SqlParameter("@OrderID", SqlDbType.VarChar, 12))
sqlDA.SelectCommand.Parameters("@OrderID").Value = sOrderID
sqlDA.SelectCommand.Parameters.Add(New SqlParameter("@StatusCode", SqlDbType.VarChar, 10))
sqlDA.SelectCommand.Parameters("@StatusCode").Value = sStatusCode
sqlDA.SelectCommand.Parameters.Add(New SqlParameter("@DivisionID", SqlDbType.VarChar, 3))
sqlDA.SelectCommand.Parameters("@DivisionID").Value = sDivisionID
sqlDA.Fill(ds) 'Fill the DataSet with the rows returned.
Return ds
sqlDA.Dispose()
conn.Close()
End Function