1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Public Function checkElpWse(ByVal codElp) As Integer
Dim check As Integer = 1
cnStr += "User Id = wse;Password=wse16_se"
Dim cn As New Oracle.ManagedDataAccess.Client.OracleConnection
Try
Dim cmd As Oracle.ManagedDataAccess.Client.OracleCommand
Dim da As Oracle.ManagedDataAccess.Client.OracleDataAdapter
Dim ds As New DataSet
cn.ConnectionString = cnStr
cn.Open()
cmd = New Oracle.ManagedDataAccess.Client.OracleCommand("SELECT COD_ELP FROM UR_WSE_ELP WHERE COD_ELP='" & codElp & "'", cn)
da = New Oracle.ManagedDataAccess.Client.OracleDataAdapter(cmd)
da.Fill(ds, "results")
If ds.Tables("results") IsNot Nothing And ds.Tables("results").Rows.Count > 0 Then
check = 0
Else
check = 1
End If
ds.Tables.Remove("results")
da.Dispose()
cmd.Dispose()
Catch ex As Exception
check = 1
Finally
If Not (cn Is Nothing) Then cn.Close()
cn.Dispose()
End Try
Return check
End Function |
Partager