jj
This commit is contained in:
parent
024d5222f7
commit
9161865a71
@ -1,5 +1,7 @@
|
|||||||
Imports Oracle.ManagedDataAccess.Client
|
Imports Oracle.ManagedDataAccess.Client
|
||||||
Imports System.Data.Odbc
|
Imports System.Data.Odbc
|
||||||
|
Imports System.Data.SqlClient
|
||||||
|
|
||||||
Public Class ClassDatabase
|
Public Class ClassDatabase
|
||||||
Private Shared connectionString As String
|
Private Shared connectionString As String
|
||||||
|
|
||||||
@ -16,6 +18,35 @@ Public Class ClassDatabase
|
|||||||
Return False
|
Return False
|
||||||
End Try
|
End Try
|
||||||
End Function
|
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)
|
Public Shared Function GetConnectionString(id As Integer)
|
||||||
Dim connectionString As String = ""
|
Dim connectionString As String = ""
|
||||||
Try
|
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") & ";"
|
' 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"
|
Case "Oracle"
|
||||||
If DTConnection.Rows(0).Item("BEMERKUNG").ToString.Contains("without tnsnames") Then
|
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") & ";"
|
DTConnection.Rows(0).Item("DATENBANK") & ")));User Id=" & DTConnection.Rows(0).Item("USERNAME") & ";Password=" & DTConnection.Rows(0).Item("PASSWORD") & ";"
|
||||||
Else
|
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"
|
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
|
Return False
|
||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Public Shared Function Execute_non_Query_withConn(ExecuteCMD As String, ConnID As Integer)
|
Public Shared Function Execute_non_Query_withConn(ExecuteCMD As String, ConnID As Integer)
|
||||||
Try
|
Try
|
||||||
Dim sw As New SW("Execute_non_Query_withConn: " & ExecuteCMD)
|
Dim sw As New SW("Execute_non_Query_withConn: " & ExecuteCMD)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user