亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? c_sqlhelper.vb

?? 這是一個訂單管理系統
?? VB
?? 第 1 頁 / 共 5 頁
字號:
?Imports System.Data.OleDb
Imports System.Data
Imports System.Xml

'****************************************************************
'   DHU
'   Copyright (c) 2006 DHU.
'****************************************************************
'****************************************************************
'ファイル名   : C_SQLHelper.vb
'項目名稱     : BAシステム
'機能概要    :	共通処理
'               The SqlHelper class is intended to encapsulate high performance, scalable best practices for 
'               common uses of SqlClient.
'作成者       : WeiZY
'確認者       : WeiZY
'編集日付     : 2006.07.26
'修正者       : WeiZY
'修正日付     : 2006.8.30
'修正內容概要 :
'****************************************************************

' ===============================================================================
' Release history
' VERSION	DESCRIPTION
'   2.0	Added support for FillDataset, UpdateDataset and "Param" helper methods
'
' ===============================================================================

Public NotInheritable Class SqlHelper

#Region "private utility methods & constructors"

    ' Since this class provides only static methods, make the default constructor private to prevent 
    ' instances from being created with "new SqlHelper()".
    Private Sub New()
    End Sub     ' New

    ' This method is used to attach array of oledbParameters to a oledbCommand.
    ' This method will assign a value of DbNull to any parameter with a direction of
    ' InputOutput and a value of null.  
    ' This behavior will prevent default values from being used, but
    ' this will be the less common case than an intended pure output parameter (derived as InputOutput)
    ' where the user provided no input value.
    ' Parameters:
    ' -command - The command to which the parameters will be added
    ' -commandParameters - an array of oledbParameters to be added to command
    Private Shared Sub AttachParameters(ByVal command As oledbCommand, ByVal commandParameters() As oledbParameter)
        If (command Is Nothing) Then Throw New ArgumentNullException("command")
        If (Not commandParameters Is Nothing) Then
            Dim p As oledbParameter
            For Each p In commandParameters
                If (Not p Is Nothing) Then
                    ' Check for derived output value with no value assigned
                    If (p.Direction = ParameterDirection.InputOutput OrElse p.Direction = ParameterDirection.Input) AndAlso p.Value Is Nothing Then
                        p.Value = DBNull.Value
                    End If
                    command.Parameters.Add(p)
                End If
            Next p
        End If
    End Sub     ' AttachParameters

    ' This method assigns dataRow column values to an array of oledbParameters.
    ' Parameters:
    ' -commandParameters: Array of oledbParameters to be assigned values
    ' -dataRow: the dataRow used to hold the stored procedure' s parameter values
    Private Overloads Shared Sub AssignParameterValues(ByVal commandParameters() As oledbParameter, ByVal dataRow As DataRow)

        If commandParameters Is Nothing OrElse dataRow Is Nothing Then
            ' Do nothing if we get no data    
            Exit Sub
        End If

        ' Set the parameters values
        Dim commandParameter As oledbParameter
        Dim i As Integer
        For Each commandParameter In commandParameters
            ' Check the parameter name
            If (commandParameter.ParameterName Is Nothing OrElse commandParameter.ParameterName.Length <= 1) Then
                Throw New Exception(String.Format("Please provide a valid parameter name on the parameter #{0}, the ParameterName property has the following value: ' {1}' .", i, commandParameter.ParameterName))
            End If
            If dataRow.Table.Columns.IndexOf(commandParameter.ParameterName.Substring(1)) <> -1 Then
                commandParameter.Value = dataRow(commandParameter.ParameterName.Substring(1))
            End If
            i = i + 1
        Next
    End Sub

    ' This method assigns an array of values to an array of oledbParameters.
    ' Parameters:
    ' -commandParameters - array of oledbParameters to be assigned values
    ' -array of objects holding the values to be assigned
    Private Overloads Shared Sub AssignParameterValues(ByVal commandParameters() As oledbParameter, ByVal parameterValues() As Object)

        Dim i As Integer
        Dim j As Integer

        If (commandParameters Is Nothing) AndAlso (parameterValues Is Nothing) Then
            ' Do nothing if we get no data
            Return
        End If

        ' We must have the same number of values as we pave parameters to put them in
        If commandParameters.Length <> parameterValues.Length Then
            Throw New ArgumentException("Parameter count does not match Parameter Value count.")
        End If

        ' Value array
        j = commandParameters.Length - 1
        For i = 0 To j
            ' If the current array value derives from IDbDataParameter, then assign its Value property
            If TypeOf parameterValues(i) Is IDbDataParameter Then
                Dim paramInstance As IDbDataParameter = CType(parameterValues(i), IDbDataParameter)
                If (paramInstance.Value Is Nothing) Then
                    commandParameters(i).Value = DBNull.Value
                Else
                    commandParameters(i).Value = paramInstance.Value
                End If
            ElseIf (parameterValues(i) Is Nothing) Then
                commandParameters(i).Value = DBNull.Value
            Else
                commandParameters(i).Value = parameterValues(i)
            End If
        Next
    End Sub     ' AssignParameterValues

    ' This method opens (if necessary) and assigns a connection, transaction, command type and parameters 
    ' to the provided command.
    ' Parameters:
    ' -command - the oledbCommand to be prepared
    ' -connection - a valid oledbconnection, on which to execute this command
    ' -transaction - a valid oledbTransaction, or ' null' 
    ' -commandType - the CommandType (stored procedure, text, etc.)
    ' -commandText - the stored procedure name or T-SQL command
    ' -commandParameters - an array of oledbParameters to be associated with the command or ' null' if no parameters are required
    Private Shared Sub PrepareCommand(ByVal command As oledbCommand, _
      ByVal connection As oledbconnection, _
      ByVal transaction As oledbTransaction, _
      ByVal commandType As CommandType, _
      ByVal commandText As String, _
      ByVal commandParameters() As oledbParameter, ByRef mustCloseConnection As Boolean)

        If (command Is Nothing) Then Throw New ArgumentNullException("command")
        If (commandText Is Nothing OrElse commandText.Length = 0) Then Throw New ArgumentNullException("commandText")

        ' If the provided connection is not open, we will open it
        If connection.State <> ConnectionState.Open Then
            connection.Open()
            mustCloseConnection = True
        Else
            mustCloseConnection = False
        End If

        ' Associate the connection with the command
        command.Connection = connection

        ' Set the command text (stored procedure name or SQL statement)
        command.CommandText = commandText

        ' If we were provided a transaction, assign it.
        If Not (transaction Is Nothing) Then
            If transaction.Connection Is Nothing Then Throw New ArgumentException("The transaction was rollbacked or commited, please provide an open transaction.", "transaction")
            command.Transaction = transaction
        End If

        ' Set the command type
        command.CommandType = commandType

        ' Attach the command parameters if they are provided
        If Not (commandParameters Is Nothing) Then
            AttachParameters(command, commandParameters)
        End If
        Return
    End Sub     ' PrepareCommand

#End Region

#Region "ExecuteNonQuery"

    ' Execute a oledbCommand (that returns no resultset and takes no parameters) against the database specified in 
    ' the connection string. 
    ' e.g.:  
    '  Dim result As Integer =  ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders")
    ' Parameters:
    ' -connectionString - a valid connection string for a oledbconnection
    ' -commandType - the CommandType (stored procedure, text, etc.)
    ' -commandText - the stored procedure name or T-SQL command
    ' Returns: An int representing the number of rows affected by the command
    Public Overloads Shared Function ExecuteNonQuery(ByVal connectionString As String, _
      ByVal commandType As CommandType, _
      ByVal commandText As String) As Integer
        ' Pass through the call providing null for the set of oledbParameters
        Return ExecuteNonQuery(connectionString, commandType, commandText, CType(Nothing, oledbParameter()))
    End Function        ' ExecuteNonQuery

    ' Execute a oledbCommand (that returns no resultset) against the database specified in the connection string 
    ' using the provided parameters.
    ' e.g.:  
    ' Dim result As Integer = ExecuteNonQuery(connString, CommandType.StoredProcedure, "PublishOrders", new oledbParameter("@prodid", 24))
    ' Parameters:
    ' -connectionString - a valid connection string for a oledbconnection
    ' -commandType - the CommandType (stored procedure, text, etc.)
    ' -commandText - the stored procedure name or T-SQL command
    ' -commandParameters - an array of SqlParamters used to execute the command
    ' Returns: An int representing the number of rows affected by the command
    Public Overloads Shared Function ExecuteNonQuery(ByVal connectionString As String, _
      ByVal commandType As CommandType, _
      ByVal commandText As String, _
      ByVal ParamArray commandParameters() As oledbParameter) As Integer
        If (connectionString Is Nothing OrElse connectionString.Length = 0) Then Throw New ArgumentNullException("connectionString")
        ' Create & open a oledbconnection, and dispose of it after we are done
        Dim connection As oledbconnection = Nothing
        Try
            connection = New oledbconnection(connectionString)
            connection.Open()

            ' Call the overload that takes a connection in place of the connection string
            Return ExecuteNonQuery(connection, commandType, commandText, commandParameters)
        Finally
            If Not connection Is Nothing Then connection.Dispose()
        End Try
    End Function        ' ExecuteNonQuery

    ' Execute a stored procedure via a oledbCommand (that returns no resultset) against the database specified in 
    ' the connection string using the provided parameter values.  This method will discover the parameters for the 
    ' stored procedure, and assign the values based on parameter order.
    ' This method provides no access to output parameters or the stored procedure' s return value parameter.
    ' e.g.:  
    '  Dim result As Integer = ExecuteNonQuery(connString, "PublishOrders", 24, 36)
    ' Parameters:
    ' -connectionString - a valid connection string for a oledbconnection

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人免费视频精品含羞草妖精| 亚洲午夜激情网页| 青青草伊人久久| 色综合亚洲欧洲| 国产视频一区在线播放| 日本不卡高清视频| 欧美色综合久久| 国产精品久久免费看| 国产在线视频精品一区| 91精品欧美综合在线观看最新| 亚洲欧美一区二区久久| 国产1区2区3区精品美女| 日韩视频中午一区| 天堂成人免费av电影一区| 91黄色免费看| 综合自拍亚洲综合图不卡区| 国产精品影视在线观看| 日韩一区二区三区四区| 五月婷婷色综合| 欧美性一区二区| 亚洲欧美韩国综合色| 成人av综合一区| 欧美经典一区二区| 国产精品一区二区久久不卡| 精品免费国产二区三区| 日本不卡一区二区| 欧美性欧美巨大黑白大战| 亚洲色欲色欲www| 成a人片亚洲日本久久| 国产日韩欧美亚洲| 国产精品中文字幕一区二区三区| 精品久久久久久久人人人人传媒 | 日本欧美一区二区三区| 欧美性猛交xxxxxxxx| 亚洲精品美腿丝袜| 色偷偷久久一区二区三区| 亚洲人xxxx| 色婷婷亚洲精品| 亚洲男人的天堂av| 欧美在线色视频| 亚洲午夜精品网| 欧美人体做爰大胆视频| 视频在线观看一区二区三区| 911精品国产一区二区在线| 日韩成人精品在线观看| 这里只有精品99re| 麻豆国产91在线播放| 欧美mv日韩mv亚洲| 国产自产高清不卡| 亚洲国产精品av| 99riav久久精品riav| 一区二区三区成人| 欧美女孩性生活视频| 欧美aaaaaa午夜精品| 久久综合丝袜日本网| 粉嫩欧美一区二区三区高清影视| 国产精品网站在线播放| av成人免费在线| 亚洲成人福利片| 日韩欧美国产成人一区二区| 国产在线国偷精品免费看| 国产精品天干天干在观线| 色综合天天在线| 日日夜夜精品视频天天综合网| 日韩三级.com| 成人高清视频免费观看| 一区二区理论电影在线观看| 91精品国产综合久久香蕉的特点| 久久er精品视频| 国产精品伦理在线| 欧美探花视频资源| 蜜桃精品视频在线| 国产精品无码永久免费888| 91国产精品成人| 毛片av一区二区| 国产女人18毛片水真多成人如厕| 99re66热这里只有精品3直播| 亚洲成人综合在线| 久久综合成人精品亚洲另类欧美| youjizz久久| 午夜欧美电影在线观看| 亚洲精品一区二区三区在线观看| 不卡一区二区中文字幕| 日韩精品1区2区3区| 精品欧美久久久| 91老司机福利 在线| 日韩电影一区二区三区四区| 国产欧美日韩卡一| 欧美在线播放高清精品| 激情成人午夜视频| 一区二区三区.www| 久久久久久久久久久99999| 色综合久久66| 极品少妇一区二区三区精品视频 | 国产精品免费久久| 欧美精品久久久久久久多人混战 | 成人国产免费视频| 日韩电影在线观看一区| 国产精品国产馆在线真实露脸| 欧美精选一区二区| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 欧美日本韩国一区二区三区视频| 福利一区福利二区| 日韩精品成人一区二区三区 | 精品剧情v国产在线观看在线| 91亚洲国产成人精品一区二三| 美女看a上一区| 亚洲伊人色欲综合网| 国产日韩影视精品| 日韩亚洲欧美综合| 欧美亚洲动漫另类| 成人黄动漫网站免费app| 久久精品久久综合| 亚洲国产精品一区二区www在线| 国产人成亚洲第一网站在线播放| 欧美剧在线免费观看网站| 成人av网址在线观看| 久久精品999| 亚洲6080在线| 亚洲三级电影网站| 日本一区二区不卡视频| 精品久久久久久久人人人人传媒| 欧美日本国产视频| 在线免费av一区| 95精品视频在线| 国产福利电影一区二区三区| 免费人成在线不卡| 亚洲国产成人av网| 亚洲精品国产无天堂网2021 | 欧美片在线播放| 在线视频亚洲一区| av综合在线播放| 国产成人啪免费观看软件| 精品一区二区国语对白| 日韩不卡一区二区三区| 亚洲第一成人在线| 91网页版在线| 日韩美女天天操| 青青草国产精品亚洲专区无| 欧美性三三影院| 最近日韩中文字幕| 99久久精品免费看国产免费软件| 欧美日韩在线电影| 亚洲激情自拍视频| 成人aa视频在线观看| 久久久精品蜜桃| 成人自拍视频在线| 亚洲精品日韩专区silk| 欧美激情中文不卡| 精品理论电影在线| 国产精品久久久久久福利一牛影视| 欧美成人激情免费网| 欧美一级欧美三级| 91精品国产一区二区三区| 欧美精品久久99久久在免费线| 欧美日韩美女一区二区| 欧美日韩国产成人在线91| 欧美影院午夜播放| 欧美日韩一区三区| 91精品国产乱| 精品欧美一区二区在线观看| 亚洲精品一区二区三区99| 久久久午夜精品| 国产清纯白嫩初高生在线观看91| 欧美国产日韩精品免费观看| 国产精品免费视频网站| 亚洲精品一二三区| 亚洲高清中文字幕| 日本中文一区二区三区| 韩国精品免费视频| 粉嫩aⅴ一区二区三区四区| www.av亚洲| 欧洲国内综合视频| 91麻豆精品国产综合久久久久久| 欧美一级高清片| 国产午夜亚洲精品理论片色戒| 国产精品美女久久久久av爽李琼| 亚洲老司机在线| 婷婷综合另类小说色区| 久久99久久精品| 成人av资源在线| 欧美综合在线视频| 91精品国产色综合久久不卡电影| 欧美成人乱码一区二区三区| 欧美激情一区二区在线| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 一区二区免费看| 日本在线不卡视频| 国产成人一区在线| 一本一本久久a久久精品综合麻豆| 欧美在线999| 精品久久人人做人人爰| 综合色天天鬼久久鬼色| 亚洲成av人综合在线观看| 久久99久久精品| 日本在线播放一区二区三区| 韩国av一区二区| 色综合久久久久久久久久久| 91精品视频网| 国产精品亲子伦对白|