MS UserItemsReplace
This commit is contained in:
@@ -271,7 +271,34 @@ Public Class ClassDatabase
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function Execute_non_Query_withConnString(ExecuteCMD As String, theconnstring As String)
|
||||
Try
|
||||
Dim sw As New SW("Execute_non_Query_withConnString: " & ExecuteCMD)
|
||||
|
||||
|
||||
Dim SQLconnect As New SqlClient.SqlConnection
|
||||
Dim SQLcommand As SqlClient.SqlCommand
|
||||
SQLconnect.ConnectionString = theconnstring
|
||||
SQLconnect.Open()
|
||||
SQLcommand = SQLconnect.CreateCommand
|
||||
'Update Last Created Record in Foo
|
||||
SQLcommand.CommandText = ExecuteCMD
|
||||
SQLcommand.CommandTimeout = 120
|
||||
SQLcommand.ExecuteNonQuery()
|
||||
SQLcommand.Dispose()
|
||||
SQLconnect.Close()
|
||||
|
||||
sw.Done()
|
||||
|
||||
Return True
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Error in Execute_non_Query_withConnString: " & ex.Message, True)
|
||||
ClassLogger.Add("SQL: " & ExecuteCMD, False)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
'TODO: Asynchrone Abfrage möglich machen
|
||||
Public Shared Sub Execute_non_Query_Async(ExecuteCMD As String, Optional Userinput As Boolean = False)
|
||||
Dim SQLconnect As New SqlClient.SqlConnection
|
||||
@@ -373,6 +400,28 @@ Public Class ClassDatabase
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
Public Shared Function Execute_ScalarWithConnectionString(connectionString As String, cmdscalar As String)
|
||||
Dim result
|
||||
Try
|
||||
|
||||
Dim SQLconnect As New SqlClient.SqlConnection
|
||||
Dim SQLcommand As SqlClient.SqlCommand
|
||||
SQLconnect.ConnectionString = connectionString
|
||||
SQLconnect.Open()
|
||||
SQLcommand = SQLconnect.CreateCommand
|
||||
'Update Last Created Record in Foo
|
||||
SQLcommand.CommandText = cmdscalar
|
||||
SQLcommand.CommandTimeout = 120
|
||||
result = SQLcommand.ExecuteScalar()
|
||||
SQLcommand.Dispose()
|
||||
SQLconnect.Close()
|
||||
Return result
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Error in Execute_ScalarWithConnectionString: " & ex.Message, True)
|
||||
ClassLogger.Add("SQL: " & cmdscalar, False)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function OracleExecute_Scalar(cmdscalar As String, OracleConnection As String)
|
||||
Dim result
|
||||
|
||||
Reference in New Issue
Block a user