_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › SSIS-ODBC覲

ろ襴渚 覲
Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Pipeline.Wrapper
Imports Microsoft.SqlServer.Dts.Runtime.Wrapper
Imports system.Data.Odbc
Imports System.Text


Public Class ScriptMain
    Inherits UserComponent

    Dim odbcConn As OdbcConnection  
    Dim odbcCmd As OdbcCommand      
    Dim odbcParam As OdbcParameter  
    Dim odbcReader As OdbcDataReader

    Public Overrides Sub AcquireConnections(ByVal Transaction As Object)
        Dim connectionString As String
        connectionString = Me.Connections.郁屋.ConnectionString
        odbcConn = New OdbcConnection(connectionString)
        odbcConn.Open()
    End Sub
    Public Overrides Sub PreExecute()
        Dim odbcCmd As New OdbcCommand("select country, city, name cityname, state from citybycountry;", odbcConn)
        odbcReader = odbcCmd.ExecuteReader
    End Sub

    Public Overrides Sub CreateNewOutputRows()
        '
        ' Add rows by calling AddRow method on member variable called "<Output Name>Buffer"
        ' E.g., MyOutputBuffer.AddRow() if your output was named "My Output"
        '
        Do While odbcReader.Read
            With 豢0Buffer
                .AddRow()
                .country = odbcReader.GetString(0)
                .city = odbcReader.GetString(1)
                .cityname = odbcReader.GetString(2)
                .state = odbcReader.GetString(3)
            End With
        Loop
    End Sub

    Public Overrides Sub PostExecute()
        odbcReader.Close()
    End Sub

    Public Overrides Sub ReleaseConnections()
        Me.Connections.郁屋.ReleaseConnection(odbcConn)
    End Sub

End Class
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:52

蠍磯 譬 所 曙 讌 襷. 豢朱 讌 襷. 蠏碁Μ螻 讌豎るり 朱 殊 覩語煙 豈 企る讌 襷. (豈蠏朱)