jj
This commit is contained in:
parent
024d5222f7
commit
9161865a71
@ -1,5 +1,7 @@
|
||||
Imports Oracle.ManagedDataAccess.Client
|
||||
Imports System.Data.Odbc
|
||||
Imports System.Data.SqlClient
|
||||
|
||||
Public Class ClassDatabase
|
||||
Private Shared connectionString As String
|
||||
|
||||
@ -16,6 +18,35 @@ Public Class ClassDatabase
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function CreateRecord_New(formId As Integer, Optional UseProxy As Boolean = False)
|
||||
Dim SQLconnect As New SqlClient.SqlConnection
|
||||
|
||||
If UseProxy = True And DD_LIB_Standards.clsDatabase.DB_PROXY_INITIALIZED Then
|
||||
SQLconnect.ConnectionString = ClassProxy.MyPROXYConnectionString
|
||||
Else
|
||||
SQLconnect.ConnectionString = ClassDatabase.connectionString
|
||||
End If
|
||||
|
||||
Using cmd As New SqlCommand("PRPMO_CREATE_RECORD", SQLconnect)
|
||||
|
||||
cmd.CommandType = CommandType.StoredProcedure
|
||||
cmd.Parameters.AddWithValue("@pFORM_ID", formId)
|
||||
cmd.Parameters.AddWithValue("@pADDED_WHO", Environment.UserName)
|
||||
cmd.Parameters.Add("@pRESULT", SqlDbType.Int)
|
||||
cmd.Parameters("@pRESULT").Direction = ParameterDirection.Output
|
||||
|
||||
SQLconnect.Open()
|
||||
cmd.ExecuteNonQuery()
|
||||
SQLconnect.Close()
|
||||
|
||||
Dim GUID As Integer = cmd.Parameters("@pRESULT").Value
|
||||
|
||||
Return GUID
|
||||
End Using
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function GetConnectionString(id As Integer)
|
||||
Dim connectionString As String = ""
|
||||
Try
|
||||
@ -32,7 +63,7 @@ Public Class ClassDatabase
|
||||
' connectionString = "Server=" & DTConnection.Rows(0).Item("SERVER") & ";Database=" & DTConnection.Rows(0).Item("DATENBANK") & ";User Id=" & DTConnection.Rows(0).Item("USERNAME") & ";Password=" & DTConnection.Rows(0).Item("PASSWORD") & ";"
|
||||
Case "Oracle"
|
||||
If DTConnection.Rows(0).Item("BEMERKUNG").ToString.Contains("without tnsnames") Then
|
||||
connectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & DTConnection.Rows(0).Item("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" & _
|
||||
connectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & DTConnection.Rows(0).Item("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" &
|
||||
DTConnection.Rows(0).Item("DATENBANK") & ")));User Id=" & DTConnection.Rows(0).Item("USERNAME") & ";Password=" & DTConnection.Rows(0).Item("PASSWORD") & ";"
|
||||
Else
|
||||
connectionString = "Data Source=" & DTConnection.Rows(0).Item("SERVER") & ";Persist Security Info=True;User Id=" & DTConnection.Rows(0).Item("USERNAME") & ";Password=" & DTConnection.Rows(0).Item("PASSWORD") & ";Unicode=True"
|
||||
@ -220,6 +251,7 @@ Public Class ClassDatabase
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function Execute_non_Query_withConn(ExecuteCMD As String, ConnID As Integer)
|
||||
Try
|
||||
Dim sw As New SW("Execute_non_Query_withConn: " & ExecuteCMD)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user