⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 productsdataset.designer.vb

📁 Microsoft Mobile Development Handbook的代码,有C#,VB,C++的
💻 VB
📖 第 1 页 / 共 5 页
字号:
        Private eventAction As System.Data.DataRowAction
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Sub New(ByVal row As ProductRow, ByVal action As System.Data.DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public ReadOnly Property Row() As ProductRow
            Get
                Return Me.eventRow
            End Get
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public ReadOnly Property Action() As System.Data.DataRowAction
            Get
                Return Me.eventAction
            End Get
        End Property
    End Class
    
    Public Class ProductCategoryRowChangeEvent
        Inherits System.EventArgs
        
        Private eventRow As ProductCategoryRow
        
        Private eventAction As System.Data.DataRowAction
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Sub New(ByVal row As ProductCategoryRow, ByVal action As System.Data.DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public ReadOnly Property Row() As ProductCategoryRow
            Get
                Return Me.eventRow
            End Get
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public ReadOnly Property Action() As System.Data.DataRowAction
            Get
                Return Me.eventAction
            End Get
        End Property
    End Class
End Class

Namespace ProductsDataSetTableAdapters
    
    <System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.ComponentModel.DataObjectAttribute(true)>  _
    Partial Public Class ProductTableAdapter
        Inherits System.ComponentModel.Component
        
        Private WithEvents _adapter As System.Data.SqlServerCe.SqlCeDataAdapter
        
        Private _connection As System.Data.SqlServerCe.SqlCeConnection
        
        Private _commandCollection() As System.Data.SqlServerCe.SqlCeCommand
        
        Private _clearBeforeFill As Boolean
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Sub New()
            MyBase.New
            Me.ClearBeforeFill = true
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private ReadOnly Property Adapter() As System.Data.SqlServerCe.SqlCeDataAdapter
            Get
                If (Me._adapter Is Nothing) Then
                    Me.InitAdapter
                End If
                Return Me._adapter
            End Get
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Friend Property Connection() As System.Data.SqlServerCe.SqlCeConnection
            Get
                If (Me._connection Is Nothing) Then
                    Me.InitConnection
                End If
                Return Me._connection
            End Get
            Set
                Me._connection = value
                If (Not (Me.Adapter.InsertCommand) Is Nothing) Then
                    Me.Adapter.InsertCommand.Connection = value
                End If
                If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then
                    Me.Adapter.DeleteCommand.Connection = value
                End If
                If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then
                    Me.Adapter.UpdateCommand.Connection = value
                End If
                Dim i As Integer = 0
                Do While (i < Me.CommandCollection.Length)
                    If (Not (Me.CommandCollection(i)) Is Nothing) Then
                        CType(Me.CommandCollection(i),System.Data.SqlServerCe.SqlCeCommand).Connection = value
                    End If
                    i = (i + 1)
                Loop
            End Set
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Protected ReadOnly Property CommandCollection() As System.Data.SqlServerCe.SqlCeCommand()
            Get
                If (Me._commandCollection Is Nothing) Then
                    Me.InitCommandCollection
                End If
                Return Me._commandCollection
            End Get
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Property ClearBeforeFill() As Boolean
            Get
                Return Me._clearBeforeFill
            End Get
            Set
                Me._clearBeforeFill = value
            End Set
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private Sub InitAdapter()
            Me._adapter = New System.Data.SqlServerCe.SqlCeDataAdapter
            Dim tableMapping As System.Data.Common.DataTableMapping = New System.Data.Common.DataTableMapping
            tableMapping.SourceTable = "Table"
            tableMapping.DataSetTable = "Product"
            tableMapping.ColumnMappings.Add("ProductID", "ProductID")
            tableMapping.ColumnMappings.Add("Name", "Name")
            tableMapping.ColumnMappings.Add("Color", "Color")
            tableMapping.ColumnMappings.Add("ListPrice", "ListPrice")
            tableMapping.ColumnMappings.Add("Size", "Size")
            tableMapping.ColumnMappings.Add("ProductCategoryID", "ProductCategoryID")
            Me._adapter.TableMappings.Add(tableMapping)
            Me._adapter.DeleteCommand = New System.Data.SqlServerCe.SqlCeCommand
            Me._adapter.DeleteCommand.Connection = Me.Connection
            Me._adapter.DeleteCommand.CommandText = "DELETE FROM [Product] WHERE (([ProductID] = @p1))"
            Me._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text
            Dim param As System.Data.SqlServerCe.SqlCeParameter = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p1"
            param.DbType = System.Data.DbType.Int32
            param.IsNullable = true
            param.SourceColumn = "ProductID"
            param.SourceVersion = System.Data.DataRowVersion.Original
            Me._adapter.DeleteCommand.Parameters.Add(param)
            Me._adapter.InsertCommand = New System.Data.SqlServerCe.SqlCeCommand
            Me._adapter.InsertCommand.Connection = Me.Connection
            Me._adapter.InsertCommand.CommandText = "INSERT INTO [Product] ([Name], [Color], [ListPrice], [Size], [ProductCategoryID])"& _ 
                " VALUES (@p1, @p2, @p3, @p4, @p5)"
            Me._adapter.InsertCommand.CommandType = System.Data.CommandType.Text
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p1"
            param.IsNullable = true
            param.SourceColumn = "Name"
            Me._adapter.InsertCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p2"
            param.IsNullable = true
            param.SourceColumn = "Color"
            Me._adapter.InsertCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p3"
            param.DbType = System.Data.DbType.Currency
            param.IsNullable = true
            param.SourceColumn = "ListPrice"
            Me._adapter.InsertCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p4"
            param.IsNullable = true
            param.SourceColumn = "Size"
            Me._adapter.InsertCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p5"
            param.DbType = System.Data.DbType.Int32
            param.IsNullable = true
            param.SourceColumn = "ProductCategoryID"
            Me._adapter.InsertCommand.Parameters.Add(param)
            Me._adapter.UpdateCommand = New System.Data.SqlServerCe.SqlCeCommand
            Me._adapter.UpdateCommand.Connection = Me.Connection
            Me._adapter.UpdateCommand.CommandText = "UPDATE [Product] SET [Name] = @p1, [Color] = @p2, [ListPrice] = @p3, [Size] = @p4"& _ 
                ", [ProductCategoryID] = @p5 WHERE (([ProductID] = @p6))"
            Me._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p1"
            param.IsNullable = true
            param.SourceColumn = "Name"
            Me._adapter.UpdateCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p2"
            param.IsNullable = true
            param.SourceColumn = "Color"
            Me._adapter.UpdateCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p3"
            param.DbType = System.Data.DbType.Currency
            param.IsNullable = true
            param.SourceColumn = "ListPrice"
            Me._adapter.UpdateCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p4"
            param.IsNullable = true
            param.SourceColumn = "Size"
            Me._adapter.UpdateCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p5"
            param.DbType = System.Data.DbType.Int32
            param.IsNullable = true
            param.SourceColumn = "ProductCategoryID"
            Me._adapter.UpdateCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p6"
            param.DbType = System.Data.DbType.Int32
            param.IsNullable = true
            param.SourceColumn = "ProductID"
            param.SourceVersion = System.Data.DataRowVersion.Original
            Me._adapter.UpdateCommand.Parameters.Add(param)
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private Sub InitConnection()
            Me._connection = New System.Data.SqlServerCe.SqlCeConnection
            Me._connection.ConnectionString = ("Data Source ="  _
                        + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase)  _
                        + ("\MyDatabase.sdf;"  _
                        + ("Password =" + """MobileP@ssw0rd"";"))))
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private Sub InitCommandCollection()
            Me._commandCollection = New System.Data.SqlServerCe.SqlCeCommand(0) {}
            Me._commandCollection(0) = New System.Data.SqlServerCe.SqlCeCommand
            Me._commandCollection(0).Connection = Me.Connection
            Me._commandCollection(0).CommandText = "SELECT [ProductID], [Name], [Color], [ListPrice], [Size], [ProductCategoryID] FRO"& _ 
                "M [Product]"
            Me._commandCollection(0).CommandType = System.Data.CommandType.Text
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)>  _
        Public Overloads Overridable Function Fill(ByVal dataTable As ProductsDataSet.ProductDataTable) As Integer
            Me.Adapter.SelectCommand = Me.CommandCollection(0)
            If (Me.ClearBeforeFill = true) Then
                dataTable.Clear
            End If
            Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
            Return returnValue
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.[Select], true)>  _
        Public Overloads Overridable Function GetData() As ProductsDataSet.ProductDataTable
            Me.Adapter.SelectCommand = Me.CommandCollection(0)
            Dim dataTable As ProductsDataSet.ProductDataTable = New ProductsDataSet.ProductDataTable
            Me.Adapter.Fill(dataTable)
            Return dataTable
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Overloads Overridable Function Update(ByVal dataTable As ProductsDataSet.ProductDataTable) As Integer
            Return Me.Adapter.Update(dataTable)
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Overloads Overridable Function Update(ByVal dataSet As ProductsDataSet) As Integer
            Return Me.Adapter.Update(dataSet, "Product")

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -