📄 dataset1.vb
字号:
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 authorsDataTable = CType(MyBase.Clone,authorsDataTable)
cln.InitVars
Return cln
End Function
Protected Overrides Function CreateInstance() As DataTable
Return New authorsDataTable
End Function
Friend Sub InitVars()
Me.columnau_id = Me.Columns("au_id")
Me.columnau_lname = Me.Columns("au_lname")
Me.columnau_fname = Me.Columns("au_fname")
Me.columnphone = Me.Columns("phone")
Me.columnaddress = Me.Columns("address")
Me.columncity = Me.Columns("city")
Me.columnstate = Me.Columns("state")
Me.columnzip = Me.Columns("zip")
Me.columncontract = Me.Columns("contract")
End Sub
Private Sub InitClass()
Me.columnau_id = New DataColumn("au_id", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnau_id)
Me.columnau_lname = New DataColumn("au_lname", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnau_lname)
Me.columnau_fname = New DataColumn("au_fname", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnau_fname)
Me.columnphone = New DataColumn("phone", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnphone)
Me.columnaddress = New DataColumn("address", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnaddress)
Me.columncity = New DataColumn("city", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columncity)
Me.columnstate = New DataColumn("state", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnstate)
Me.columnzip = New DataColumn("zip", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnzip)
Me.columncontract = New DataColumn("contract", GetType(System.Boolean), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columncontract)
Me.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.columnau_id}, true))
Me.columnau_id.AllowDBNull = false
Me.columnau_id.Unique = true
Me.columnau_lname.AllowDBNull = false
Me.columnau_fname.AllowDBNull = false
Me.columnphone.AllowDBNull = false
Me.columncontract.AllowDBNull = false
End Sub
Public Function NewauthorsRow() As authorsRow
Return CType(Me.NewRow,authorsRow)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New authorsRow(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(authorsRow)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.authorsRowChangedEvent) Is Nothing) Then
RaiseEvent authorsRowChanged(Me, New authorsRowChangeEvent(CType(e.Row,authorsRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.authorsRowChangingEvent) Is Nothing) Then
RaiseEvent authorsRowChanging(Me, New authorsRowChangeEvent(CType(e.Row,authorsRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.authorsRowDeletedEvent) Is Nothing) Then
RaiseEvent authorsRowDeleted(Me, New authorsRowChangeEvent(CType(e.Row,authorsRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.authorsRowDeletingEvent) Is Nothing) Then
RaiseEvent authorsRowDeleting(Me, New authorsRowChangeEvent(CType(e.Row,authorsRow), e.Action))
End If
End Sub
Public Sub RemoveauthorsRow(ByVal row As authorsRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class authorsRow
Inherits DataRow
Private tableauthors As authorsDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableauthors = CType(Me.Table,authorsDataTable)
End Sub
Public Property au_id As String
Get
Return CType(Me(Me.tableauthors.au_idColumn),String)
End Get
Set
Me(Me.tableauthors.au_idColumn) = value
End Set
End Property
Public Property au_lname As String
Get
Return CType(Me(Me.tableauthors.au_lnameColumn),String)
End Get
Set
Me(Me.tableauthors.au_lnameColumn) = value
End Set
End Property
Public Property au_fname As String
Get
Return CType(Me(Me.tableauthors.au_fnameColumn),String)
End Get
Set
Me(Me.tableauthors.au_fnameColumn) = value
End Set
End Property
Public Property phone As String
Get
Return CType(Me(Me.tableauthors.phoneColumn),String)
End Get
Set
Me(Me.tableauthors.phoneColumn) = value
End Set
End Property
Public Property address As String
Get
Try
Return CType(Me(Me.tableauthors.addressColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableauthors.addressColumn) = value
End Set
End Property
Public Property city As String
Get
Try
Return CType(Me(Me.tableauthors.cityColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableauthors.cityColumn) = value
End Set
End Property
Public Property state As String
Get
Try
Return CType(Me(Me.tableauthors.stateColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableauthors.stateColumn) = value
End Set
End Property
Public Property zip As String
Get
Try
Return CType(Me(Me.tableauthors.zipColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("Cannot get value because it is DBNull.", e)
End Try
End Get
Set
Me(Me.tableauthors.zipColumn) = value
End Set
End Property
Public Property contract As Boolean
Get
Return CType(Me(Me.tableauthors.contractColumn),Boolean)
End Get
Set
Me(Me.tableauthors.contractColumn) = value
End Set
End Property
Public Function IsaddressNull() As Boolean
Return Me.IsNull(Me.tableauthors.addressColumn)
End Function
Public Sub SetaddressNull()
Me(Me.tableauthors.addressColumn) = System.Convert.DBNull
End Sub
Public Function IscityNull() As Boolean
Return Me.IsNull(Me.tableauthors.cityColumn)
End Function
Public Sub SetcityNull()
Me(Me.tableauthors.cityColumn) = System.Convert.DBNull
End Sub
Public Function IsstateNull() As Boolean
Return Me.IsNull(Me.tableauthors.stateColumn)
End Function
Public Sub SetstateNull()
Me(Me.tableauthors.stateColumn) = System.Convert.DBNull
End Sub
Public Function IszipNull() As Boolean
Return Me.IsNull(Me.tableauthors.zipColumn)
End Function
Public Sub SetzipNull()
Me(Me.tableauthors.zipColumn) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class authorsRowChangeEvent
Inherits EventArgs
Private eventRow As authorsRow
Private eventAction As DataRowAction
Public Sub New(ByVal row As authorsRow, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As authorsRow
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 + -