Public Function AddressTypeReadAll(ByVal _langCult As String) As DataTable
Dim dtAddrTypes As New DataTable
Dim prmList(1) As SqlParameter
prmList(0) = New SqlParameter("@LangCult", SqlDbType.VarChar, 15)
prmList(0).Value = _langCult
dtAddrTypes = RunProcedureDReader("dbo.procAddressType_GetAll", prmList, "tblAddrTypes")
Return dtAddrTypes
End Function
Public Function RunProcedureDReader(ByVal storedProcName As String, _
ByVal parameters As IDataParameter(), _
ByVal tableName As String) As DataTable
Dim dt As New DataTable
Dim objCmd As New SqlCommand(storedProcName, strConn)
Dim parameter As SqlParameter
objCmd.CommandType = CommandType.StoredProcedure
For Each parameter In parameters
objCmd.Parameters.Add(parameter)
Next
strConn.Open()
Dim dr As SqlDataReader = objCmd.ExecuteReader()
dt.Load(dr)
strConn.Close()
Return dt
End Function
|