Public Shared Function getOEMPN(ByVal psPN As String, ByRef OEMPN As String) As BSResult
Dim clsResult As New BSResult
Try
clsResult.ResultID =-1
Dim dtResult As New DataTable
Dim Sql As String = String.Empty
Dim clsOraDb As New clsOraClienDb
Dim strConn As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
clsOraDb.Open(strConn) ‘这里Open后,后面看不到 clsOraDb.Close
Sql ="SELECT SATBMMBRND.OEMPN FRUNO FROM SATBMMBRND WHERE SATBMMBRND.MATNO = :MATNO"
Dim params() As racleParameter = {New OracleParameter("MATNO", psPN)}
If clsOraDb.FillDataTable(Sql, dtResult, params) = False Then
Return clsResult
End If
If dtResult Is Nothing Then
Return clsResult
End If
If dtResult.Rows.Count >0 Then
OEMPN = dtResult.Rows(0)("FRUNO").ToString()
Else
OEMPN =""
End If
clsResult.ResultID =1
Return clsResult
Catch ex As Exception