Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
433
Server/ToolProject/RCMS_Tool/DBAgent.vb
Normal file
433
Server/ToolProject/RCMS_Tool/DBAgent.vb
Normal file
@@ -0,0 +1,433 @@
|
||||
#If False Then
|
||||
***********************************************************************
|
||||
* .netXpert DataAccess Component Version 1.0
|
||||
* Written By Funnyfox
|
||||
* Last Comment 2001.11.4
|
||||
***********************************************************************
|
||||
#End If
|
||||
|
||||
Imports System.Data
|
||||
Imports System.Data.SqlClient
|
||||
'Imports System.EnterpriseServices ' Serviced Component <20><> ȣ<><C8A3><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Namespce
|
||||
Imports System.Configuration.ConfigurationSettings 'Config File <20><><EFBFBD><EFBFBD>(AppSettings <20><>)<29><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Namesapce
|
||||
Imports System.Runtime.InteropServices 'Interop Namespace
|
||||
|
||||
'**********************************************************************************
|
||||
' Transaction <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Support
|
||||
' COM+ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڿ<EFBFBD><DABF><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. Default => " "(space)
|
||||
' JIT Activation <20><><EFBFBD><EFBFBD>
|
||||
' ClassInterface <20><> AutoDual ( COM+ Service <20>ֿܼ<DCBC><D6BF><EFBFBD> Interface <20><> <20><> <20><> <20>ֵ<EFBFBD><D6B5><EFBFBD> )
|
||||
'**********************************************************************************
|
||||
|
||||
|
||||
Public Class DBAgent
|
||||
'Connection Field
|
||||
Private m_Connection As SqlConnection
|
||||
|
||||
'Connection <20><> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> Return
|
||||
Private Function MakeConnection(ByVal ConnectionString As String) As SqlConnection
|
||||
Dim sqlConn As SqlConnection
|
||||
|
||||
Try
|
||||
sqlConn = New SqlConnection(ConnectionString)
|
||||
Catch Ex As Exception
|
||||
'ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
Ex.ToString()
|
||||
End Try
|
||||
Return sqlConn
|
||||
End Function
|
||||
|
||||
|
||||
'Connection String Property
|
||||
Property ConnectionString() As String
|
||||
Set(ByVal Value As String)
|
||||
m_Connection = MakeConnection(Value)
|
||||
End Set
|
||||
Get
|
||||
If m_Connection Is Nothing Then
|
||||
Return GetConnection().ConnectionString
|
||||
Else
|
||||
Return m_Connection.ConnectionString
|
||||
End If
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
'************************************************************************************
|
||||
' Query <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Բ<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD>ͷ<EFBFBD> <20>Ѱ<EFBFBD>,
|
||||
' <20><><EFBFBD><EFBFBD><EFBFBD>ͼ¿<CDBC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ä<><C3A4><EFBFBD><EFBFBD>
|
||||
'************************************************************************************
|
||||
|
||||
Public Overloads Function FillDataSet(ByVal strQuery As String, ByVal strAlias As String, ByRef dsDataSet As DataSet) As DataSet
|
||||
Dim sqlAdapter As SqlDataAdapter = New SqlDataAdapter(strQuery, GetConnection())
|
||||
Try
|
||||
sqlAdapter.Fill(dsDataSet, strAlias)
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
|
||||
Return dsDataSet
|
||||
End Function
|
||||
|
||||
'************************************************************************************
|
||||
' Query <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Բ<EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD><CCBA><EFBFBD><EFBFBD><EFBFBD> <20>ѱ<EFBFBD><D1B1><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD> <20><><EFBFBD><EFBFBD>(Untyped) <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'************************************************************************************
|
||||
Public Overloads Function FillDataSet(ByVal strQuery As String, ByVal strAlias As String) As DataSet
|
||||
Dim sqlAdapter As SqlDataAdapter = New SqlDataAdapter(strQuery, GetConnection())
|
||||
Dim oDs As New DataSet()
|
||||
Try
|
||||
sqlAdapter.Fill(oDs, strAlias)
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
|
||||
Return oDs
|
||||
End Function
|
||||
|
||||
'**************************************************************************************************
|
||||
' SP<53≯<EFBFBD><CCB8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD> <20><EFBFBD><D7B8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD><CCBA><EFBFBD><EFBFBD><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD> <20>ѱ<EFBFBD><D1B1><EFBFBD>(clsParam<61><6D>ü),
|
||||
' <20>̿<EFBFBD> <20>ش<EFBFBD><D8B4>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ͼ¿<CDBC> ä<><C3A4> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'**************************************************************************************************
|
||||
Public Overloads Function FillDataSet(ByVal SPName As String, ByRef dsDataSet As DataSet, ByVal strAlias As String, ByVal ParamArray objParams() As clsParam) As DataSet
|
||||
Dim sqlComm As SqlCommand = New SqlCommand(SPName, GetConnection())
|
||||
Dim oEachParams As clsParam
|
||||
Dim SqlAdapter As SqlDataAdapter = New SqlDataAdapter()
|
||||
|
||||
Try
|
||||
sqlComm.CommandType = CommandType.StoredProcedure
|
||||
sqlComm.CommandText = SPName
|
||||
|
||||
For Each oEachParams In objParams
|
||||
sqlComm.Parameters.Add(MakeParameter(oEachParams))
|
||||
Next
|
||||
|
||||
SqlAdapter.SelectCommand = sqlComm
|
||||
SqlAdapter.Fill(dsDataSet, strAlias)
|
||||
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
|
||||
Return dsDataSet
|
||||
End Function
|
||||
|
||||
'**************************************************************************************************
|
||||
' SP<53≯<EFBFBD><CCB8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD><CCBA><EFBFBD><EFBFBD><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD>͵<EFBFBD><CDB5><EFBFBD> <20>ѱ<EFBFBD><D1B1><EFBFBD>(clsParam<61><6D>ü),
|
||||
' <20>̿<EFBFBD> <20>ش<EFBFBD><D8B4>ϴ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD> ä<><C3A4> <20><><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'**************************************************************************************************
|
||||
Public Overloads Function FillDataSet(ByVal SPName As String, ByVal strAlias As String, ByVal ParamArray objParams() As clsParam) As DataSet
|
||||
Dim sqlComm As SqlCommand = New SqlCommand(SPName, GetConnection())
|
||||
Dim oEachParams As clsParam
|
||||
Dim SqlAdapter As SqlDataAdapter = New SqlDataAdapter()
|
||||
Dim oDs As New DataSet()
|
||||
|
||||
Try
|
||||
sqlComm.CommandType = CommandType.StoredProcedure
|
||||
sqlComm.CommandText = SPName
|
||||
|
||||
For Each oEachParams In objParams
|
||||
sqlComm.Parameters.Add(MakeParameter(oEachParams))
|
||||
Next
|
||||
|
||||
SqlAdapter.SelectCommand = sqlComm
|
||||
SqlAdapter.Fill(oDs, strAlias)
|
||||
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
Return oDs
|
||||
End Function
|
||||
|
||||
'**************************************************************************************************
|
||||
' Insert / update /delete Query <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> SP <20><> ȣ<><C8A3><EFBFBD>Ҷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD>, SP <20><><EFBFBD><EFBFBD> <20>䱸<EFBFBD>Ǵ<EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD>͵<EFBFBD>(clsParam <20><>ü)
|
||||
' <20><> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD>ͷ<EFBFBD> <20>ѱ<EFBFBD><D1B1><EFBFBD> SP<53><50> ȣ<><C8A3><EFBFBD>Ǹ<EFBFBD> <20>̿<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ڵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'**************************************************************************************************
|
||||
Public Overloads Function ExecuteSpNonQuery(ByVal SPName As String, ByVal ParamArray objParams() As clsParam) As Integer
|
||||
Dim sqlComm As SqlCommand = New SqlCommand(SPName, GetConnection())
|
||||
Dim oEachParams As clsParam
|
||||
Dim intRet As Integer
|
||||
Try
|
||||
sqlComm.CommandType = CommandType.StoredProcedure
|
||||
sqlComm.CommandText = SPName
|
||||
|
||||
For Each oEachParams In objParams
|
||||
sqlComm.Parameters.Add(MakeParameter(oEachParams))
|
||||
Next
|
||||
|
||||
sqlComm.Connection.Open()
|
||||
intRet = sqlComm.ExecuteNonQuery()
|
||||
If Not (sqlComm.Connection.State = ConnectionState.Closed) Then sqlComm.Connection.Close()
|
||||
Return intRet
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
Return 0
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
'**************************************************************************************************
|
||||
' Insert / update /delete Query <20><><EFBFBD><EFBFBD> ȣ<><C8A3><EFBFBD>Ҷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϸ<EFBFBD> <20>̿<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ڵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'**************************************************************************************************
|
||||
Public Overloads Function ExecuteNonQuery(ByVal strQuery As String) As Integer
|
||||
Dim sqlComm As SqlCommand = New SqlCommand(strQuery, GetConnection())
|
||||
Dim oEachParams As clsParam
|
||||
Dim intRet As Integer
|
||||
Try
|
||||
sqlComm.CommandType = CommandType.Text
|
||||
sqlComm.CommandText = strQuery
|
||||
sqlComm.Connection.Open()
|
||||
intRet = sqlComm.ExecuteNonQuery()
|
||||
If Not (sqlComm.Connection.State = ConnectionState.Closed) Then sqlComm.Connection.Close()
|
||||
Return intRet
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
Return 0
|
||||
End Try
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
'************************************************************************************
|
||||
' SP <20><><EFBFBD><EFBFBD> clsParam Object<63><74> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>,
|
||||
' DataReader <20><> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'************************************************************************************
|
||||
Public Overloads Function ReturnDataReader(ByVal SPName As String, ByVal ParamArray objParams() As clsParam) As SqlDataReader
|
||||
Dim sqlComm As SqlCommand = New SqlCommand(SPName, GetConnection())
|
||||
Dim oEachParams As clsParam
|
||||
Dim sqlReader As SqlDataReader
|
||||
Try
|
||||
sqlComm.CommandType = CommandType.StoredProcedure
|
||||
sqlComm.CommandText = SPName
|
||||
|
||||
For Each oEachParams In objParams
|
||||
sqlComm.Parameters.Add(MakeParameter(oEachParams))
|
||||
Next
|
||||
|
||||
sqlComm.Connection.Open()
|
||||
'DataReader <20><>ü<EFBFBD><C3BC> close <20>ϸ<EFBFBD> <20>̿<EFBFBD> <20>ش<EFBFBD><D8B4>ϴ<EFBFBD> Connection <20><> <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
sqlReader = sqlComm.ExecuteReader(CommandBehavior.CloseConnection)
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
Return sqlReader
|
||||
End Function
|
||||
|
||||
'************************************************************************************
|
||||
' Sql Query <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> DataReader <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'************************************************************************************
|
||||
Public Overloads Function ReturnDataReader(ByVal strQuery As String) As SqlDataReader
|
||||
|
||||
Dim sqlComm As SqlCommand = New SqlCommand()
|
||||
Dim sqlReader As SqlDataReader
|
||||
Try
|
||||
sqlComm.Connection = GetConnection()
|
||||
sqlComm.CommandType = CommandType.Text
|
||||
sqlComm.CommandText = strQuery
|
||||
|
||||
sqlComm.Connection.Open()
|
||||
'DataReader <20><>ü<EFBFBD><C3BC> close <20>ϸ<EFBFBD> <20>̿<EFBFBD> <20>ش<EFBFBD><D8B4>ϴ<EFBFBD> Connection <20><> <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
sqlReader = sqlComm.ExecuteReader(CommandBehavior.CloseConnection)
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
Return sqlReader
|
||||
End Function
|
||||
|
||||
'************************************************************************************
|
||||
' SP <20><><EFBFBD><EFBFBD> clsParam Object<63><74> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD>Ͽ<EFBFBD> SP<53><50> <20><><EFBFBD><EFBFBD>,
|
||||
' <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20>÷<EFBFBD><C3B7><EFBFBD><EFBFBD><EFBFBD> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>(Return Value).
|
||||
'************************************************************************************
|
||||
Public Function ReturnParameter(ByVal SPName As String, ByVal ParamArray objParams() As clsParam) As SqlParameterCollection
|
||||
|
||||
Dim sqlComm As SqlCommand = New SqlCommand(SPName, GetConnection())
|
||||
Dim oEachParams As clsParam
|
||||
Try
|
||||
sqlComm.CommandType = CommandType.StoredProcedure
|
||||
sqlComm.CommandText = SPName
|
||||
If Not (objParams Is Nothing) Then
|
||||
For Each oEachParams In objParams
|
||||
sqlComm.Parameters.Add(MakeParameter(oEachParams))
|
||||
Next
|
||||
End If
|
||||
|
||||
sqlComm.Connection.Open()
|
||||
sqlComm.ExecuteNonQuery()
|
||||
If Not (sqlComm.Connection.State = ConnectionState.Closed) Then sqlComm.Connection.Close()
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
Return sqlComm.Parameters
|
||||
End Function
|
||||
|
||||
|
||||
'************************************************************************************
|
||||
' SP <20><><EFBFBD><EFBFBD> clsParam Object<63><74> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><>ü<EFBFBD><C3BC> <20><><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>,
|
||||
' Scalar <20><><EFBFBD><EFBFBD> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'************************************************************************************
|
||||
Public Overloads Function ReturnScalarValue(ByVal SPName As String, ByVal ParamArray objParams() As clsParam) As Object
|
||||
Dim sqlComm As SqlCommand = New SqlCommand(SPName, GetConnection())
|
||||
Dim oEachParams As clsParam
|
||||
Dim objRet As Object
|
||||
Try
|
||||
sqlComm.CommandType = CommandType.StoredProcedure
|
||||
sqlComm.CommandText = SPName
|
||||
If Not (objParams Is Nothing) Then
|
||||
For Each oEachParams In objParams
|
||||
sqlComm.Parameters.Add(MakeParameter(oEachParams))
|
||||
Next
|
||||
End If
|
||||
sqlComm.Connection.Open()
|
||||
objRet = sqlComm.ExecuteScalar()
|
||||
If Not (sqlComm.Connection.State = ConnectionState.Closed) Then sqlComm.Connection.Close()
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
Return objRet
|
||||
End Function
|
||||
|
||||
|
||||
Public Overloads Function ReturnScalarValue(ByVal strQuery As String) As Object
|
||||
'************************************************************************************
|
||||
' Query <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>,Scalar <20><><EFBFBD><EFBFBD> <20>ǵ<EFBFBD><C7B5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
'************************************************************************************
|
||||
Dim sqlComm As SqlCommand = New SqlCommand(strQuery, GetConnection())
|
||||
Dim objRet As Object
|
||||
Try
|
||||
sqlComm.CommandType = CommandType.Text
|
||||
sqlComm.Connection.Open()
|
||||
objRet = sqlComm.ExecuteScalar()
|
||||
If Not (sqlComm.Connection.State = ConnectionState.Closed) Then sqlComm.Connection.Close()
|
||||
Catch Ex As Exception
|
||||
ErrorUtil.WriteExceptionIntoEventLog(Ex)
|
||||
End Try
|
||||
Return objRet
|
||||
End Function
|
||||
|
||||
'Connection <20><>ü<EFBFBD><C3BC> <20>ǵ<EFBFBD><C7B5><EFBFBD>, m_Connection <20><> <20><><EFBFBD><EFBFBD><EFBFBD>Ǿ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> m_Connection<6F><6E> Connection <20><>ü<EFBFBD><C3BC>
|
||||
'<27><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> Assign.
|
||||
Private Function GetConnection() As SqlConnection
|
||||
If m_Connection Is Nothing Then
|
||||
m_Connection = MakeConnection(System.Configuration.ConfigurationSettings.AppSettings("ConnectionString"))
|
||||
End If
|
||||
Return m_Connection
|
||||
End Function
|
||||
|
||||
'clsParam <20><>ü<EFBFBD><C3BC> <20><><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ͽ<EFBFBD> SqlParameter <20><>ü<EFBFBD><C3BC> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
|
||||
Private Function MakeParameter(ByVal oParams As clsParam) As SqlParameter
|
||||
Dim MakedParameter As SqlParameter = New SqlParameter()
|
||||
With MakedParameter
|
||||
.ParameterName = oParams.ParamName
|
||||
.SqlDbType = oParams.ParamType
|
||||
.Size = oParams.ParamSize
|
||||
.Value = oParams.ParamValue
|
||||
.Direction = oParams.ParamDirection
|
||||
.Precision = oParams.ParamPrecision
|
||||
.Scale = oParams.ParamScale
|
||||
End With
|
||||
Return MakedParameter
|
||||
End Function
|
||||
End Class
|
||||
|
||||
|
||||
'***********************************************************
|
||||
' SqlCommand <20><> Parameter <20><>ü <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ƴ<EFBFBD><C6B3><EFBFBD> <20><><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD>
|
||||
'***********************************************************
|
||||
Public Class clsParam
|
||||
Private m_ParamName As String '<27>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><>
|
||||
Private m_ParamType As SqlDbType '<27>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><>Ÿ<EFBFBD><C5B8>
|
||||
Private m_ParamSize As Integer '<27>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
Private m_ParamValue As Object '<27>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><>
|
||||
Private m_ParamDirection As ParameterDirection ' <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>(input / output)
|
||||
Private m_ParamPrecision As Byte 'Precision
|
||||
Private m_ParamScale As Byte 'Scale
|
||||
|
||||
ReadOnly Property ParamName() As String
|
||||
Get
|
||||
Return m_ParamName
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property ParamType() As SqlDbType
|
||||
Get
|
||||
Return m_ParamType
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property ParamSize() As Integer
|
||||
Get
|
||||
Return m_ParamSize
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property ParamValue() As Object
|
||||
Get
|
||||
Return m_ParamValue
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property ParamDirection() As ParameterDirection
|
||||
Get
|
||||
Return m_ParamDirection
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property ParamScale() As Byte
|
||||
Get
|
||||
Return m_ParamPrecision
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property ParamPrecision() As Byte
|
||||
Get
|
||||
Return m_ParamScale
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
'Scale <20><> Precision <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
Public Sub New(ByVal ParamName As String, ByVal ParamType As SqlDbType, ByVal ParamSize As Integer, _
|
||||
ByVal ParamValue As Object, ByVal ParamDirection As ParameterDirection)
|
||||
Me.m_ParamName = ParamName
|
||||
Me.m_ParamType = ParamType
|
||||
Me.m_ParamSize = ParamSize
|
||||
Me.m_ParamValue = ParamValue
|
||||
Me.m_ParamDirection = ParamDirection
|
||||
Me.m_ParamScale = 0
|
||||
Me.m_ParamPrecision = 0
|
||||
End Sub
|
||||
|
||||
'Scale <20><> Presicion <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʿ<EFBFBD><CABF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD>Ͱ<EFBFBD> Input Ÿ<><C5B8><EFBFBD>϶<EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
Public Sub New(ByVal ParamName As String, ByVal ParamType As SqlDbType, ByVal ParamSize As Integer, _
|
||||
ByVal ParamValue As Object)
|
||||
Me.m_ParamName = ParamName
|
||||
Me.m_ParamType = ParamType
|
||||
Me.m_ParamSize = ParamSize
|
||||
Me.m_ParamValue = ParamValue
|
||||
Me.m_ParamDirection = ParameterDirection.Input
|
||||
Me.m_ParamScale = 0
|
||||
Me.m_ParamPrecision = 0
|
||||
End Sub
|
||||
|
||||
'<27><><EFBFBD><EFBFBD> <20>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Է<EFBFBD><D4B7>ؾ<EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
||||
Public Sub New(ByVal ParamName As String, ByVal ParamType As SqlDbType, ByVal ParamSize As Integer, _
|
||||
ByVal ParamValue As Object, ByVal ParamScale As Byte, ByVal ParamPrecision As Byte)
|
||||
Me.m_ParamName = ParamName
|
||||
Me.m_ParamType = ParamType
|
||||
Me.m_ParamSize = ParamSize
|
||||
Me.m_ParamValue = ParamValue
|
||||
Me.m_ParamDirection = ParameterDirection.Input
|
||||
Me.m_ParamScale = ParamScale
|
||||
Me.m_ParamPrecision = ParamPrecision
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user