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

📄 adventureworksdataset.designer.vb

📁 wrox出版社的另一套经典的VB2005数据库编程学习书籍,收集了书中源码,郑重推荐,电子书,电子书下载
💻 VB
📖 第 1 页 / 共 4 页
字号:
        Inherits System.Data.DataRow
        
        Private tableProductPhoto As ProductPhotoDataTable
        
        Friend Sub New(ByVal rb As System.Data.DataRowBuilder)
            MyBase.New(rb)
            Me.tableProductPhoto = CType(Me.Table,ProductPhotoDataTable)
        End Sub
        
        Public Property ProductPhotoID() As Integer
            Get
                Return CType(Me(Me.tableProductPhoto.ProductPhotoIDColumn),Integer)
            End Get
            Set
                Me(Me.tableProductPhoto.ProductPhotoIDColumn) = value
            End Set
        End Property
        
        Public Property ThumbNailPhoto() As Byte()
            Get
                Try 
                    Return CType(Me(Me.tableProductPhoto.ThumbNailPhotoColumn),Byte())
                Catch e As System.InvalidCastException
                    Throw New System.Data.StrongTypingException("The value for column 'ThumbNailPhoto' in table 'ProductPhoto' is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableProductPhoto.ThumbNailPhotoColumn) = value
            End Set
        End Property
        
        Public Property ThumbnailPhotoFileName() As String
            Get
                Try 
                    Return CType(Me(Me.tableProductPhoto.ThumbnailPhotoFileNameColumn),String)
                Catch e As System.InvalidCastException
                    Throw New System.Data.StrongTypingException("The value for column 'ThumbnailPhotoFileName' in table 'ProductPhoto' is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableProductPhoto.ThumbnailPhotoFileNameColumn) = value
            End Set
        End Property
        
        Public Property LargePhoto() As Byte()
            Get
                Try 
                    Return CType(Me(Me.tableProductPhoto.LargePhotoColumn),Byte())
                Catch e As System.InvalidCastException
                    Throw New System.Data.StrongTypingException("The value for column 'LargePhoto' in table 'ProductPhoto' is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableProductPhoto.LargePhotoColumn) = value
            End Set
        End Property
        
        Public Property LargePhotoFileName() As String
            Get
                Try 
                    Return CType(Me(Me.tableProductPhoto.LargePhotoFileNameColumn),String)
                Catch e As System.InvalidCastException
                    Throw New System.Data.StrongTypingException("The value for column 'LargePhotoFileName' in table 'ProductPhoto' is DBNull.", e)
                End Try
            End Get
            Set
                Me(Me.tableProductPhoto.LargePhotoFileNameColumn) = value
            End Set
        End Property
        
        Public Property ModifiedDate() As Date
            Get
                Return CType(Me(Me.tableProductPhoto.ModifiedDateColumn),Date)
            End Get
            Set
                Me(Me.tableProductPhoto.ModifiedDateColumn) = value
            End Set
        End Property
        
        Public Function IsThumbNailPhotoNull() As Boolean
            Return Me.IsNull(Me.tableProductPhoto.ThumbNailPhotoColumn)
        End Function
        
        Public Sub SetThumbNailPhotoNull()
            Me(Me.tableProductPhoto.ThumbNailPhotoColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsThumbnailPhotoFileNameNull() As Boolean
            Return Me.IsNull(Me.tableProductPhoto.ThumbnailPhotoFileNameColumn)
        End Function
        
        Public Sub SetThumbnailPhotoFileNameNull()
            Me(Me.tableProductPhoto.ThumbnailPhotoFileNameColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsLargePhotoNull() As Boolean
            Return Me.IsNull(Me.tableProductPhoto.LargePhotoColumn)
        End Function
        
        Public Sub SetLargePhotoNull()
            Me(Me.tableProductPhoto.LargePhotoColumn) = System.Convert.DBNull
        End Sub
        
        Public Function IsLargePhotoFileNameNull() As Boolean
            Return Me.IsNull(Me.tableProductPhoto.LargePhotoFileNameColumn)
        End Function
        
        Public Sub SetLargePhotoFileNameNull()
            Me(Me.tableProductPhoto.LargePhotoFileNameColumn) = System.Convert.DBNull
        End Sub
    End Class
    
    Public Class ProductPhotoRowChangeEvent
        Inherits System.EventArgs
        
        Private eventRow As ProductPhotoRow
        
        Private eventAction As System.Data.DataRowAction
        
        Public Sub New(ByVal row As ProductPhotoRow, ByVal action As System.Data.DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        Public ReadOnly Property Row() As ProductPhotoRow
            Get
                Return Me.eventRow
            End Get
        End Property
        
        Public ReadOnly Property Action() As System.Data.DataRowAction
            Get
                Return Me.eventAction
            End Get
        End Property
    End Class
End Class

Namespace AdventureWorksDataSetTableAdapters
    
    <System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.ComponentModel.ToolboxItem(true),  _
     System.ComponentModel.DataObjectAttribute(true),  _
     System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"& _ 
        ", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"),  _
     System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")>  _
    Partial Public Class ProductPhotoTableAdapter
        Inherits System.ComponentModel.Component
        
        Private WithEvents m_adapter As System.Data.SqlClient.SqlDataAdapter
        
        Private m_connection As System.Data.SqlClient.SqlConnection
        
        Private m_commandCollection() As System.Data.SqlClient.SqlCommand
        
        Private m_clearBeforeFill As Boolean
        
        Public Sub New()
            MyBase.New
            Me.m_clearBeforeFill = true
        End Sub
        
        Private ReadOnly Property Adapter() As System.Data.SqlClient.SqlDataAdapter
            Get
                If (Me.m_adapter Is Nothing) Then
                    Me.InitAdapter
                End If
                Return Me.m_adapter
            End Get
        End Property
        
        Friend Property Connection() As System.Data.SqlClient.SqlConnection
            Get
                If (Me.m_connection Is Nothing) Then
                    Me.InitConnection
                End If
                Return Me.m_connection
            End Get
            Set
                Me.m_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.SqlClient.SqlCommand).Connection = value
                    End If
                    i = (i + 1)
                Loop
            End Set
        End Property
        
        Protected ReadOnly Property CommandCollection() As System.Data.SqlClient.SqlCommand()
            Get
                If (Me.m_commandCollection Is Nothing) Then
                    Me.InitCommandCollection
                End If
                Return Me.m_commandCollection
            End Get
        End Property
        
        Public Property ClearBeforeFill() As Boolean
            Get
                Return Me.m_clearBeforeFill
            End Get
            Set
                Me.m_clearBeforeFill = value
            End Set
        End Property
        
        Private Sub InitAdapter()
            Me.m_adapter = New System.Data.SqlClient.SqlDataAdapter
            Dim tableMapping As System.Data.Common.DataTableMapping = New System.Data.Common.DataTableMapping
            tableMapping.SourceTable = "Table"
            tableMapping.DataSetTable = "ProductPhoto"
            tableMapping.ColumnMappings.Add("ProductPhotoID", "ProductPhotoID")
            tableMapping.ColumnMappings.Add("ThumbNailPhoto", "ThumbNailPhoto")

⌨️ 快捷键说明

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