?? ds0.vb
字號:
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.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.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.Constraints.Add(New UniqueConstraint("Constraint1", New DataColumn() {Me.column人員編號}, true))
Me.column人員編號.AllowDBNull = false
Me.column人員編號.Unique = true
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 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 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 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 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 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
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 + -