Created all SQL components. Here's the stored procedure:
ALTER PROCEDURE [dbo].[procImpoundRec_Get]
@ID intASBEGIN
SET NOCOUNT ON;
SELECT * FROM tblImpoundRecs WHERE ID = @IDEND
Here's the Interface in AADM_Service_Interface:
<servicecontract()>
Public Interface AADM_Service_Interface <operationcontract()>
Function Impound_Get(ByVal ID As Integer) As String
End Interface
Here's the implementation:
Public Class AADM_Service Implements AADM_Service_Interface
Public Function Impound_GetRecord(ID As Integer) As String
Implements AADM_Service_Interface.Impound_Get
Dim objConnect As New SqlConnection(ConnectionStrings.AADM)
Dim myCommand As SqlCommand = New SqlCommand
Dim strReturnRecord As String = ""
With myCommand
.Connection = objConnect
.CommandText = "procImpoundRec_Get"
.CommandType = CommandType.StoredProcedure
.Parameters.Add(New SqlParameter("@ID", ID))
End With
Dim objDataAdapter As New SqlDataAdapter(myCommand)
Dim ds As New DataSet
Try objDataAdapter.Fill(ds)
strReturnRecord = ds.GetXml
Catch ex As Exception
End Try
Return strReturnRecord
End Function
End Class