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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? c_sqlhelper.vb

?? 這是一個訂單管理系統(tǒng)
?? 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
'修正內(nèi)容概要 :
'****************************************************************

' ===============================================================================
' 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
eeuss鲁片一区二区三区在线观看| 中文字幕在线一区| 91亚洲永久精品| 成人污污视频在线观看| 国产精品一区免费在线观看| 精品一区二区三区不卡| 精品一区二区在线看| 韩国三级中文字幕hd久久精品| 看电视剧不卡顿的网站| 国内成人精品2018免费看| 国产精品18久久久久久久网站| 国产成人精品亚洲日本在线桃色| 国产精品系列在线观看| 91一区二区在线| 欧美精品亚洲一区二区在线播放| 欧美精品黑人性xxxx| 欧美成人一区二区| 中文字幕乱码久久午夜不卡| 一区二区成人在线视频| 日本系列欧美系列| 国产成人av福利| 欧美亚一区二区| 日韩情涩欧美日韩视频| 欧美国产激情一区二区三区蜜月 | 欧美一区二区在线观看| 91精品国产综合久久婷婷香蕉| 欧美大片在线观看一区二区| 欧美精品一区二区三区很污很色的 | 26uuu欧美| 最新成人av在线| 久久精品国产久精国产| 色综合久久综合中文综合网| 9191国产精品| 国产精品高潮呻吟久久| 亚洲视频资源在线| 日本亚洲免费观看| 岛国一区二区三区| 欧美高清你懂得| 亚洲欧洲色图综合| 精品制服美女久久| 91国偷自产一区二区三区成为亚洲经典 | 狠狠色丁香婷婷综合久久片| 成人app网站| 7777精品伊人久久久大香线蕉完整版| 精品久久久久香蕉网| 亚洲精品视频在线观看网站| 久久av中文字幕片| 欧洲中文字幕精品| 中文字幕二三区不卡| 日本成人中文字幕| 在线免费不卡电影| 国产精品亲子伦对白| 久久99久久久欧美国产| 欧美日韩日本视频| 亚洲视频香蕉人妖| 成人午夜免费电影| 久久久久久久久久久电影| 日韩一区欧美二区| 欧美xxxxxxxxx| 亚洲午夜视频在线观看| 国产91丝袜在线播放| 日韩一区二区在线观看视频播放| 一区二区久久久久| 色婷婷精品久久二区二区蜜臀av | 色婷婷亚洲一区二区三区| 欧美国产禁国产网站cc| 国产一区二区主播在线| 欧美精品一区二区三区蜜臀| 美女www一区二区| 欧美一区二区成人6969| 日本成人在线一区| 日韩视频永久免费| 看电视剧不卡顿的网站| 欧美videossexotv100| 精品综合免费视频观看| 久久婷婷国产综合国色天香| 国产一区 二区 三区一级| 久久久99免费| 粉嫩欧美一区二区三区高清影视| 亚洲国产精品二十页| 99久久久久久99| 亚洲一区在线电影| 欧美一级夜夜爽| 精品亚洲免费视频| 久久精品欧美一区二区三区麻豆| 国产高清精品网站| 亚洲丝袜另类动漫二区| 欧美日韩一区 二区 三区 久久精品| 亚洲精选视频在线| 777午夜精品视频在线播放| 久久99精品久久久久婷婷| 日本一区二区成人在线| 欧美在线不卡视频| 美日韩一区二区| 国产精品五月天| 欧美色男人天堂| 国产综合久久久久久久久久久久| 中文无字幕一区二区三区| 91久久国产综合久久| 久久国产成人午夜av影院| 中文字幕乱码日本亚洲一区二区| 色婷婷综合激情| 美洲天堂一区二卡三卡四卡视频 | 午夜视频久久久久久| 精品国免费一区二区三区| 岛国精品一区二区| 亚洲成a人在线观看| 久久久久久99久久久精品网站| 91蝌蚪porny九色| 麻豆精品一区二区三区| 亚洲蜜臀av乱码久久精品| 欧美一区二区成人6969| 91在线观看高清| 国产福利一区二区三区| 午夜精品久久久久久久久| 国产亚洲一二三区| 91精品国产麻豆国产自产在线| 国产ts人妖一区二区| 三级成人在线视频| 国产欧美一区二区三区网站| 欧美丰满一区二区免费视频| 99这里都是精品| 国产一区二区三区电影在线观看 | 免费视频一区二区| 17c精品麻豆一区二区免费| 91精品国产乱码| 91成人网在线| 成人av资源在线观看| 国产综合色在线| 亚洲香蕉伊在人在线观| 亚洲欧洲美洲综合色网| 欧美激情综合五月色丁香小说| 欧美一级片在线观看| 欧美色爱综合网| 99国产欧美另类久久久精品| 国产成人精品影视| 久久99精品国产91久久来源| 喷白浆一区二区| 亚洲成人av中文| 亚洲国产视频a| 亚洲综合网站在线观看| 亚洲免费观看高清在线观看| 亚洲欧美在线高清| 国产精品乱人伦| 亚洲国产高清不卡| 国产三级精品三级在线专区| 国产日韩欧美a| 国产片一区二区| 国产精品天美传媒| 国产精品免费人成网站| 亚洲欧洲另类国产综合| 一区视频在线播放| 亚洲欧美偷拍三级| 玉米视频成人免费看| 一区二区在线观看av| 亚洲国产精品一区二区久久恐怖片 | 欧美成人综合网站| 欧美v亚洲v综合ⅴ国产v| 欧美精品电影在线播放| 日韩欧美国产精品一区| 久久理论电影网| 国产精品美女久久久久aⅴ | 欧美三级电影网站| 欧美高清性hdvideosex| 日韩一区国产二区欧美三区| 精品国精品国产| 国产精品视频九色porn| 国产精品夫妻自拍| 亚洲老妇xxxxxx| 午夜精品影院在线观看| 美女视频免费一区| 成人午夜大片免费观看| 91视频91自| 欧美一区二区三区在线| 久久一二三国产| 亚洲欧美电影一区二区| 日产欧产美韩系列久久99| 国产精品一色哟哟哟| 在线精品亚洲一区二区不卡| 欧美不卡在线视频| 国产精品天美传媒沈樵| 天天操天天色综合| 国产精品一二二区| 欧美性生活大片视频| 久久网这里都是精品| 亚洲综合一区二区三区| 国产精品一区不卡| 欧美综合久久久| 欧美韩国日本综合| 亚洲国产va精品久久久不卡综合| 国产一区二区成人久久免费影院| 91黄色小视频| 亚洲国产精品99久久久久久久久 | 久久久蜜桃精品| 午夜激情一区二区| 99久久99久久精品国产片果冻| 欧美一区二区三区视频在线 | 4438x亚洲最大成人网| 亚洲视频一区二区免费在线观看| 麻豆精品新av中文字幕|