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

📄 dataset1.vb

📁 vb.net+SQL开发工具 是一个很好的管理系统的源码
💻 VB
📖 第 1 页 / 共 4 页
字号:
            Me.DisplayExpression = table.DisplayExpression
        End Sub
        
        <System.ComponentModel.Browsable(false)>  _
        Public ReadOnly Property Count As Integer
            Get
                Return Me.Rows.Count
            End Get
        End Property
        
        Friend ReadOnly Property 课程编号Column As DataColumn
            Get
                Return Me.column课程编号
            End Get
        End Property
        
        Friend ReadOnly Property 课程名称Column As DataColumn
            Get
                Return Me.column课程名称
            End Get
        End Property
        
        Friend ReadOnly Property 课程简称Column As DataColumn
            Get
                Return Me.column课程简称
            End Get
        End Property
        
        Friend ReadOnly Property 拼音码Column As DataColumn
            Get
                Return Me.column拼音码
            End Get
        End Property
        
        Friend ReadOnly Property 本学期课程Column As DataColumn
            Get
                Return Me.column本学期课程
            End Get
        End Property
        
        Friend ReadOnly Property 教师Column As DataColumn
            Get
                Return Me.column教师
            End Get
        End Property
        
        Friend ReadOnly Property 开课系别Column As DataColumn
            Get
                Return Me.column开课系别
            End Get
        End Property
        
        Friend ReadOnly Property 学分Column As DataColumn
            Get
                Return Me.column学分
            End Get
        End Property
        
        Public Default ReadOnly Property Item(ByVal index As Integer) As 课程信息Row
            Get
                Return CType(Me.Rows(index),课程信息Row)
            End Get
        End Property
        
        Public Event 课程信息RowChanged As 课程信息RowChangeEventHandler
        
        Public Event 课程信息RowChanging As 课程信息RowChangeEventHandler
        
        Public Event 课程信息RowDeleted As 课程信息RowChangeEventHandler
        
        Public Event 课程信息RowDeleting As 课程信息RowChangeEventHandler
        
        Public Overloads Sub Add课程信息Row(ByVal row As 课程信息Row)
            Me.Rows.Add(row)
        End Sub
        
        Public Overloads Function Add课程信息Row(ByVal 课程编号 As Integer, ByVal 课程名称 As String, ByVal 课程简称 As String, ByVal 拼音码 As String, ByVal 本学期课程 As String, ByVal 教师 As String, ByVal 开课系别 As String, ByVal 学分 As Integer) As 课程信息Row
            Dim row课程信息Row As 课程信息Row = CType(Me.NewRow,课程信息Row)
            row课程信息Row.ItemArray = New Object() {课程编号, 课程名称, 课程简称, 拼音码, 本学期课程, 教师, 开课系别, 学分}
            Me.Rows.Add(row课程信息Row)
            Return row课程信息Row
        End Function
        
        Public Function FindBy课程编号(ByVal 课程编号 As Integer) As 课程信息Row
            Return CType(Me.Rows.Find(New Object() {课程编号}),课程信息Row)
        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 课程信息DataTable = CType(MyBase.Clone,课程信息DataTable)
            cln.InitVars
            Return cln
        End Function
        
        Protected Overrides Function CreateInstance() As DataTable
            Return New 课程信息DataTable
        End Function
        
        Friend Sub InitVars()
            Me.column课程编号 = Me.Columns("课程编号")
            Me.column课程名称 = Me.Columns("课程名称")
            Me.column课程简称 = Me.Columns("课程简称")
            Me.column拼音码 = Me.Columns("拼音码")
            Me.column本学期课程 = Me.Columns("本学期课程")
            Me.column教师 = Me.Columns("教师")
            Me.column开课系别 = Me.Columns("开课系别")
            Me.column学分 = Me.Columns("学分")
        End Sub
        
        Private Sub InitClass()
            Me.column课程编号 = New DataColumn("课程编号", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column课程编号)
            Me.column课程名称 = New DataColumn("课程名称", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column课程名称)
            Me.column课程简称 = New DataColumn("课程简称", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column课程简称)
            Me.column拼音码 = New DataColumn("拼音码", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column拼音码)
            Me.column本学期课程 = New DataColumn("本学期课程", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column本学期课程)
            Me.column教师 = New DataColumn("教师", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column教师)
            Me.column开课系别 = New DataColumn("开课系别", GetType(System.String), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column开课系别)
            Me.column学分 = New DataColumn("学分", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
            Me.Columns.Add(Me.column学分)
            Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.column课程编号}, true))
            Me.column课程编号.AllowDBNull = false
            Me.column课程编号.Unique = true
            Me.column课程名称.AllowDBNull = false
            Me.column课程简称.AllowDBNull = false
            Me.column本学期课程.AllowDBNull = false
        End Sub
        
        Public Function New课程信息Row() As 课程信息Row
            Return CType(Me.NewRow,课程信息Row)
        End Function
        
        Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
            Return New 课程信息Row(builder)
        End Function
        
        Protected Overrides Function GetRowType() As System.Type
            Return GetType(课程信息Row)
        End Function
        
        Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanged(e)
            If (Not (Me.课程信息RowChangedEvent) Is Nothing) Then
                RaiseEvent 课程信息RowChanged(Me, New 课程信息RowChangeEvent(CType(e.Row,课程信息Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowChanging(e)
            If (Not (Me.课程信息RowChangingEvent) Is Nothing) Then
                RaiseEvent 课程信息RowChanging(Me, New 课程信息RowChangeEvent(CType(e.Row,课程信息Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleted(e)
            If (Not (Me.课程信息RowDeletedEvent) Is Nothing) Then
                RaiseEvent 课程信息RowDeleted(Me, New 课程信息RowChangeEvent(CType(e.Row,课程信息Row), e.Action))
            End If
        End Sub
        
        Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
            MyBase.OnRowDeleting(e)
            If (Not (Me.课程信息RowDeletingEvent) Is Nothing) Then
                RaiseEvent 课程信息RowDeleting(Me, New 课程信息RowChangeEvent(CType(e.Row,课程信息Row), e.Action))
            End If
        End Sub
        
        Public Sub Remove课程信息Row(ByVal row As 课程信息Row)
            Me.Rows.Remove(row)
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class 课程信息Row
        Inherits DataRow
        
        Private table课程信息 As 课程信息DataTable
        
        Friend Sub New(ByVal rb As DataRowBuilder)
            MyBase.New(rb)
            Me.table课程信息 = CType(Me.Table,课程信息DataTable)
        End Sub
        
        Public Property 课程编号 As Integer
            Get
                Return CType(Me(Me.table课程信息.课程编号Column),Integer)
            End Get
            Set
                Me(Me.table课程信息.课程编号Column) = value
            End Set
        End Property
        
        Public Property 课程名称 As String
            Get
                Return CType(Me(Me.table课程信息.课程名称Column),String)
            End Get
            Set
                Me(Me.table课程信息.课程名称Column) = value
            End Set
        End Property
        
        Public Property 课程简称 As String
            Get
                Return CType(Me(Me.table课程信息.课程简称Column),String)
            End Get
            Set
                Me(Me.table课程信息.课程简称Column) = value
            End Set
        End Property
        
        Public Property 拼音码 As String
            Get
                Try 
                    Return CType(Me(Me.table课程信息.拼音码Column),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.table课程信息.拼音码Column) = value
            End Set
        End Property
        
        Public Property 本学期课程 As String
            Get
                Return CType(Me(Me.table课程信息.本学期课程Column),String)
            End Get
            Set
                Me(Me.table课程信息.本学期课程Column) = value
            End Set
        End Property
        
        Public Property 教师 As String
            Get
                Try 
                    Return CType(Me(Me.table课程信息.教师Column),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.table课程信息.教师Column) = value
            End Set
        End Property
        
        Public Property 开课系别 As String
            Get
                Try 
                    Return CType(Me(Me.table课程信息.开课系别Column),String)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.table课程信息.开课系别Column) = value
            End Set
        End Property
        
        Public Property 学分 As Integer
            Get
                Try 
                    Return CType(Me(Me.table课程信息.学分Column),Integer)
                Catch e As InvalidCastException
                    Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
                End Try
            End Get
            Set
                Me(Me.table课程信息.学分Column) = value
            End Set
        End Property
        
        Public Function Is拼音码Null() As Boolean
            Return Me.IsNull(Me.table课程信息.拼音码Column)
        End Function
        
        Public Sub Set拼音码Null()
            Me(Me.table课程信息.拼音码Column) = System.Convert.DBNull
        End Sub
        
        Public Function Is教师Null() As Boolean
            Return Me.IsNull(Me.table课程信息.教师Column)
        End Function
        
        Public Sub Set教师Null()
            Me(Me.table课程信息.教师Column) = System.Convert.DBNull
        End Sub
        
        Public Function Is开课系别Null() As Boolean
            Return Me.IsNull(Me.table课程信息.开课系别Column)
        End Function
        
        Public Sub Set开课系别Null()
            Me(Me.table课程信息.开课系别Column) = System.Convert.DBNull
        End Sub
        
        Public Function Is学分Null() As Boolean
            Return Me.IsNull(Me.table课程信息.学分Column)
        End Function
        
        Public Sub Set学分Null()
            Me(Me.table课程信息.学分Column) = System.Convert.DBNull
        End Sub
    End Class
    
    <System.Diagnostics.DebuggerStepThrough()>  _
    Public Class 课程信息RowChangeEvent
        Inherits EventArgs
        
        Private eventRow As 课程信息Row
        
        Private eventAction As DataRowAction
        
        Public Sub New(ByVal row As 课程信息Row, ByVal action As DataRowAction)
            MyBase.New
            Me.eventRow = row
            Me.eventAction = action
        End Sub
        
        Public ReadOnly Property Row As 课程信息Row
            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 + -