📄 dataset4.vb
字号:
Me.columnanount = Me.Columns("anount")
End Sub
Private Sub InitClass()
Me.columnaname = New DataColumn("aname", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnaname)
Me.columnano = New DataColumn("ano", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnano)
Me.columndescript = New DataColumn("descript", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columndescript)
Me.columnprice = New DataColumn("price", GetType(System.Decimal), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnprice)
Me.columnstand = New DataColumn("stand", GetType(System.String), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnstand)
Me.columnanount = New DataColumn("anount", GetType(System.Int32), Nothing, System.Data.MappingType.Element)
Me.Columns.Add(Me.columnanount)
End Sub
Public Function NewaccessoryRow() As accessoryRow
Return CType(Me.NewRow,accessoryRow)
End Function
Protected Overrides Function NewRowFromBuilder(ByVal builder As DataRowBuilder) As DataRow
Return New accessoryRow(builder)
End Function
Protected Overrides Function GetRowType() As System.Type
Return GetType(accessoryRow)
End Function
Protected Overrides Sub OnRowChanged(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.accessoryRowChangedEvent) Is Nothing) Then
RaiseEvent accessoryRowChanged(Me, New accessoryRowChangeEvent(CType(e.Row,accessoryRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowChanging(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.accessoryRowChangingEvent) Is Nothing) Then
RaiseEvent accessoryRowChanging(Me, New accessoryRowChangeEvent(CType(e.Row,accessoryRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleted(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.accessoryRowDeletedEvent) Is Nothing) Then
RaiseEvent accessoryRowDeleted(Me, New accessoryRowChangeEvent(CType(e.Row,accessoryRow), e.Action))
End If
End Sub
Protected Overrides Sub OnRowDeleting(ByVal e As DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.accessoryRowDeletingEvent) Is Nothing) Then
RaiseEvent accessoryRowDeleting(Me, New accessoryRowChangeEvent(CType(e.Row,accessoryRow), e.Action))
End If
End Sub
Public Sub RemoveaccessoryRow(ByVal row As accessoryRow)
Me.Rows.Remove(row)
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class accessoryRow
Inherits DataRow
Private tableaccessory As accessoryDataTable
Friend Sub New(ByVal rb As DataRowBuilder)
MyBase.New(rb)
Me.tableaccessory = CType(Me.Table,accessoryDataTable)
End Sub
Public Property aname As String
Get
Try
Return CType(Me(Me.tableaccessory.anameColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableaccessory.anameColumn) = value
End Set
End Property
Public Property ano As String
Get
Try
Return CType(Me(Me.tableaccessory.anoColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableaccessory.anoColumn) = value
End Set
End Property
Public Property descript As String
Get
Try
Return CType(Me(Me.tableaccessory.descriptColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableaccessory.descriptColumn) = value
End Set
End Property
Public Property price As Decimal
Get
Try
Return CType(Me(Me.tableaccessory.priceColumn),Decimal)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableaccessory.priceColumn) = value
End Set
End Property
Public Property stand As String
Get
Try
Return CType(Me(Me.tableaccessory.standColumn),String)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableaccessory.standColumn) = value
End Set
End Property
Public Property anount As Integer
Get
Try
Return CType(Me(Me.tableaccessory.anountColumn),Integer)
Catch e As InvalidCastException
Throw New StrongTypingException("无法获取值,因为它是 DBNull。", e)
End Try
End Get
Set
Me(Me.tableaccessory.anountColumn) = value
End Set
End Property
Public Function IsanameNull() As Boolean
Return Me.IsNull(Me.tableaccessory.anameColumn)
End Function
Public Sub SetanameNull()
Me(Me.tableaccessory.anameColumn) = System.Convert.DBNull
End Sub
Public Function IsanoNull() As Boolean
Return Me.IsNull(Me.tableaccessory.anoColumn)
End Function
Public Sub SetanoNull()
Me(Me.tableaccessory.anoColumn) = System.Convert.DBNull
End Sub
Public Function IsdescriptNull() As Boolean
Return Me.IsNull(Me.tableaccessory.descriptColumn)
End Function
Public Sub SetdescriptNull()
Me(Me.tableaccessory.descriptColumn) = System.Convert.DBNull
End Sub
Public Function IspriceNull() As Boolean
Return Me.IsNull(Me.tableaccessory.priceColumn)
End Function
Public Sub SetpriceNull()
Me(Me.tableaccessory.priceColumn) = System.Convert.DBNull
End Sub
Public Function IsstandNull() As Boolean
Return Me.IsNull(Me.tableaccessory.standColumn)
End Function
Public Sub SetstandNull()
Me(Me.tableaccessory.standColumn) = System.Convert.DBNull
End Sub
Public Function IsanountNull() As Boolean
Return Me.IsNull(Me.tableaccessory.anountColumn)
End Function
Public Sub SetanountNull()
Me(Me.tableaccessory.anountColumn) = System.Convert.DBNull
End Sub
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class accessoryRowChangeEvent
Inherits EventArgs
Private eventRow As accessoryRow
Private eventAction As DataRowAction
Public Sub New(ByVal row As accessoryRow, ByVal action As DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub
Public ReadOnly Property Row As accessoryRow
Get
Return Me.eventRow
End Get
End Property
Public ReadOnly Property Action As DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class
<System.Diagnostics.DebuggerStepThrough()> _
Public Class storeDataTable
Inherits DataTable
Implements System.Collections.IEnumerable
Private columnaname As DataColumn
Private columnano As DataColumn
Private columndescript As DataColumn
Private columnprice As DataColumn
Private columnstand As DataColumn
Private columnanount As DataColumn
Friend Sub New()
MyBase.New("store")
Me.InitClass
End Sub
Friend Sub New(ByVal table As DataTable)
MyBase.New(table.TableName)
If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
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 anameColumn As DataColumn
Get
Return Me.columnaname
End Get
End Property
Friend ReadOnly Property anoColumn As DataColumn
Get
Return Me.columnano
End Get
End Property
Friend ReadOnly Property descriptColumn As DataColumn
Get
Return Me.columndescript
End Get
End Property
Friend ReadOnly Property priceColumn As DataColumn
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -