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

📄 dataset1.vb

📁 ASP做成的同学录,
💻 VB
📖 第 1 页 / 共 2 页
字号:
        Public Function FindBytong_id(ByVal tong_id As String) As classmaterRow
            Return CType(Me.Rows.Find(New Object() {tong_id}),classmaterRow)
        End Function
        
        Public Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
            Return Me.Rows.GetEnumerator
        End Function
        
        Public Overrides Function Clone() As DataTable
            Dim cln As classmaterDataTable = CType(MyBase.Clone,classmaterDataTable)
            cln.InitVars
            Return cln
        End Function
        
        Protected Overrides Function CreateInstance() As DataTable
            Return New classmaterDataTable
        End Function
        
        Friend Sub InitVars()
            Me.columntong_id = Me.Columns("tong_id")
            Me.columntong_name = Me.Columns("tong_name")
            Me.columntong_phone = Me.Columns("tong_phone")
            Me.columntong_shou = Me.Columns("tong_shou")
            Me.columntong_school = Me.Columns("tong_school")
            Me.columntong_home = Me.Columns("tong_home")
        End Sub
        
        Private Sub InitClass()
            Me.columntong_id = New DataColumn("tong_id", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columntong_id)
            Me.columntong_name = New DataColumn("tong_name", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columntong_name)
            Me.columntong_phone = New DataColumn("tong_phone", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columntong_phone)
            Me.columntong_shou = New DataColumn("tong_shou", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columntong_shou)
            Me.columntong_school = New DataColumn("tong_school", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columntong_school)
            Me.columntong_home = New DataColumn("tong_home", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.columntong_home)
            Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.columntong_id}, true))
            Me.columntong_id.AllowDBNull = false
            Me.columntong_id.Unique = true
        End Sub
        
        Public Function NewclassmaterRow() As classmaterRow
            Return CType(Me.NewRow,classmaterRow)
        End Function
        
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New classmaterRow(builder)
        End Function
        
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(classmaterRow)
        End Function
        
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
            If (Not (Me.classmaterRowChangedEvent) Is Nothing) Then
                RaiseEvent classmaterRowChanged(Me, New classmaterRowChangeEvent(CType(e.Row,classmaterRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
            If (Not (Me.classmaterRowChangingEvent) Is Nothing) Then
                RaiseEvent classmaterRowChanging(Me, New classmaterRowChangeEvent(CType(e.Row,classmaterRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
            If (Not (Me.classmaterRowDeletedEvent) Is Nothing) Then
                RaiseEvent classmaterRowDeleted(Me, New classmaterRowChangeEvent(CType(e.Row,classmaterRow), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
            If (Not (Me.classmaterRowDeletingEvent) Is Nothing) Then
                RaiseEvent classmaterRowDeleting(Me, New classmaterRowChangeEvent(CType(e.Row,classmaterRow), e.Action))
            End If
        End Sub
        
        Public Sub RemoveclassmaterRow(ByVal row As classmaterRow)
            Me.Rows.Remove(row)
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class classmaterRow
        Inherits DataRow
        
        Private tableclassmater As classmaterDataTable
        
        Friend Sub New(ByVal rb As DataRowBuilder)
            MyBase.New(rb)
            Me.tableclassmater = CType(Me.Table,classmaterDataTable)
        End Sub
        
        Public Property tong_id As String
            Get
                Return CType(Me(Me.tableclassmater.tong_idColumn),String)
            End Get
            Set
                Me(Me.tableclassmater.tong_idColumn) = value
            End Set
        End Property
        
        Public Property tong_name As String
            Get
                Try 
                    Return CType(Me(Me.tableclassmater.tong_nameColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableclassmater.tong_nameColumn) = value
            End Set
        End Property
        
        Public Property tong_phone As String
            Get
                Try 
                    Return CType(Me(Me.tableclassmater.tong_phoneColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableclassmater.tong_phoneColumn) = value
            End Set
        End Property
        
        Public Property tong_shou As String
            Get
                Try 
                    Return CType(Me(Me.tableclassmater.tong_shouColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableclassmater.tong_shouColumn) = value
            End Set
        End Property
        
        Public Property tong_school As String
            Get
                Try 
                    Return CType(Me(Me.tableclassmater.tong_schoolColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableclassmater.tong_schoolColumn) = value
            End Set
        End Property
        
        Public Property tong_home As String
            Get
                Try 
                    Return CType(Me(Me.tableclassmater.tong_homeColumn),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.tableclassmater.tong_homeColumn) = value
            End Set
        End Property
        
        Public Function Istong_nameNull() As Boolean
            Return Me.IsNull(Me.tableclassmater.tong_nameColumn)
        End Function
        
        Public Sub Settong_nameNull()
            Me(Me.tableclassmater.tong_nameColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Istong_phoneNull() As Boolean
            Return Me.IsNull(Me.tableclassmater.tong_phoneColumn)
        End Function
        
        Public Sub Settong_phoneNull()
            Me(Me.tableclassmater.tong_phoneColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Istong_shouNull() As Boolean
            Return Me.IsNull(Me.tableclassmater.tong_shouColumn)
        End Function
        
        Public Sub Settong_shouNull()
            Me(Me.tableclassmater.tong_shouColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Istong_schoolNull() As Boolean
            Return Me.IsNull(Me.tableclassmater.tong_schoolColumn)
        End Function
        
        Public Sub Settong_schoolNull()
            Me(Me.tableclassmater.tong_schoolColumn) = System.Convert.DBNull
        End Sub
        
        Public Function Istong_homeNull() As Boolean
            Return Me.IsNull(Me.tableclassmater.tong_homeColumn)
        End Function
        
        Public Sub Settong_homeNull()
            Me(Me.tableclassmater.tong_homeColumn) = System.Convert.DBNull
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class classmaterRowChangeEvent
        Inherits EventArgs
        
        Private eventRow As classmaterRow
        
        Private eventAction As DataRowAction
        
        Public Sub New(ByVal row As classmaterRow, ByVal action As DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        Public ReadOnly Property Row As classmaterRow
            Get
                Return Me.eventRow
            End Get
        End Property
        
        Public ReadOnly Property Action As DataRowAction
            Get
                Return Me.eventAction
            End Get
        End Property
    End Class
End Class

⌨️ 快捷键说明

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