本文整理匯總了VB.NET中System.Data.DataRow.RowState屬性的典型用法代碼示例。如果您正苦於以下問題:VB.NET DataRow.RowState屬性的具體用法?VB.NET DataRow.RowState怎麽用?VB.NET DataRow.RowState使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類System.Data.DataRow
的用法示例。
在下文中一共展示了DataRow.RowState屬性的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: DemonstrateRowState
Private Sub DemonstrateRowState()
' Run a function to create a DataTable with one column.
Dim table As DataTable = MakeTable()
Dim row As DataRow
' Create a new DataRow.
row = table.NewRow()
' Detached row.
Console.WriteLine("New Row " & row.RowState)
table.Rows.Add(row)
' New row.
Console.WriteLine("AddRow " & row.RowState)
table.AcceptChanges()
' Unchanged row.
Console.WriteLine("AcceptChanges " & row.RowState)
row("FirstName") = "Scott"
' Modified row.
Console.WriteLine("Modified " & row.RowState)
row.Delete()
' Deleted row.
Console.WriteLine("Deleted " & row.RowState)
End Sub
Private Function MakeTable() As DataTable
' Make a simple table with one column.
Dim table As New DataTable("table")
Dim dcFirstName As New DataColumn( _
"FirstName", Type.GetType("System.String"))
table.Columns.Add(dcFirstName)
MakeTable = table
End Function