Sub Main()
Dim table As New DataTable()
' This example examines a number of scenarios involving the
' DataTable.Load method.
Console.WriteLine("Load a DataTable and infer its schema:")
' Retrieve a data reader, based on the Customers data. In
' an application, this data might be coming from a middle-tier
' business object:
Dim reader As New DataTableReader(GetCustomers())
' The table has no schema. The Load method will infer the
' schema from the IDataReader:
table.Load(reader)
PrintColumns(table)
Console.WriteLine(" ============================= ")
Console.WriteLine( _
"Load a DataTable from an incompatible IDataReader:")
' Create a table with a single integer column. Attempt
' to load data from a reader with a schema that is
' incompatible. Note the exception, determined
' by the particular incompatibility:
table = GetIntegerTable()
reader = New DataTableReader(GetStringTable())
table.Load(reader)
Catch ex As Exception
Console.WriteLine(ex.GetType.Name & ":" & ex.Message())
End Try
Console.WriteLine(" ============================= ")
Console.WriteLine( _
"Load a DataTable with an IDataReader that has extra columns:")
' Note that loading a reader with extra columns adds
' the columns to the existing table, if possible:
table = GetIntegerTable()
reader = New DataTableReader(GetCustomers())
table.Load(reader)
PrintColumns(table)
Console.WriteLine(" ============================= ")
Console.WriteLine( _
"Load a DataTable with an IDataReader that has missing columns:")
' Note that loading a reader with missing columns causes
' the columns to be filled with null data, if possible:
table = GetCustomers()
reader = New DataTableReader(GetIntegerTable())
table.Load(reader)
PrintColumns(table)
' Demonstrate the various possibilites when loading data into
' a DataTable that already contains data.
Console.WriteLine(" ============================= ")
Console.WriteLine("Demonstrate data considerations:")
Console.WriteLine("Current value, Original value, (RowState)")
Console.WriteLine(" ============================= ")
Console.WriteLine("Original table:")
table = SetupModifiedRows()
DisplayRowState(table)
Console.WriteLine(" ============================= ")
Console.WriteLine("Data in IDataReader to be loaded:")
DisplayRowState(GetChangedCustomers())
PerformDemo(LoadOption.OverwriteChanges)
PerformDemo(LoadOption.PreserveChanges)
PerformDemo(LoadOption.Upsert)
Console.WriteLine("Press any key to continue.")
Console.ReadKey()
End Sub
Private Sub DisplayRowState(ByVal table As DataTable)
For i As Integer = 0 To table.Rows.Count - 1
Dim current As Object = "--"
Dim original As Object = "--"
Dim rowState As DataRowState = table.Rows(i).RowState
' Attempt to retrieve the current value, which doesn't exist
' for deleted rows:
If rowState <> DataRowState.Deleted Then
current = table.Rows(i)("Name", DataRowVersion.Current)
End If
' Attempt to retrieve the original value, which doesn't exist
' for added rows:
If rowState <> DataRowState.Added Then
original = table.Rows(i)("Name", DataRowVersion.Original)
End If
Console.WriteLine("{0}: {1}, {2} ({3})", i, _
current, original, rowState)
End Sub
Private Function GetChangedCustomers() As DataTable
' Create sample Customers table.
Dim table As New DataTable
' Create two columns, ID and Name.
Dim idColumn As DataColumn = table.Columns.Add("ID", _
GetType(Integer))
table.Columns.Add("Name", GetType(String))
' Set the ID column as the primary key column.
table.PrimaryKey = New DataColumn() {idColumn}
table.Rows.Add(New Object() {0, "XXX"})
table.Rows.Add(New Object() {1, "XXX"})
table.Rows.Add(New Object() {2, "XXX"})
table.Rows.Add(New Object() {3, "XXX"})
table.Rows.Add(New Object() {4, "XXX"})
table.AcceptChanges()
Return table
End Function
Private Function GetCustomers() As DataTable
' Create sample Customers table.
Dim table As New DataTable
' Create two columns, ID and Name.
Dim idColumn As DataColumn = table.Columns.Add("ID", _
GetType(Integer))
table.Columns.Add("Name", GetType(String))
' Set the ID column as the primary key column.
table.PrimaryKey = New DataColumn() {idColumn}
table.Rows.Add(New Object() {0, "Mary"})
table.Rows.Add(New Object() {1, "Andy"})
table.Rows.Add(New Object() {2, "Peter"})
table.AcceptChanges()
Return table
End Function
Private Function GetIntegerTable() As DataTable
' Create sample table with a single Int32 column.
Dim table As New DataTable
Dim idColumn As DataColumn = table.Columns.Add("ID", _
GetType(Integer))
' Set the ID column as the primary key column.
table.PrimaryKey = New DataColumn() {idColumn}
table.Rows.Add(New Object() {4})
table.Rows.Add(New Object() {5})
table.AcceptChanges()
Return table
End Function
Private Function GetStringTable() As DataTable
' Create sample table with a single String column.
Dim table As New DataTable
Dim idColumn As DataColumn = table.Columns.Add("ID", _
GetType(String))
' Set the ID column as the primary key column.
table.PrimaryKey = New DataColumn() {idColumn}
table.Rows.Add(New Object() {"Mary"})
table.Rows.Add(New Object() {"Andy"})
table.Rows.Add(New Object() {"Peter"})
table.AcceptChanges()
Return table
End Function
Private Sub PerformDemo(ByVal optionForLoad As LoadOption)
' Load data into a DataTable, retrieve a DataTableReader containing
' different data, and call the Load method. Depending on the
' LoadOption value passed as a parameter, this procedure displays
' different results in the DataTable.
Console.WriteLine(" ============================= ")
Console.WriteLine("table.Load(reader, {0})", optionForLoad)
Console.WriteLine(" ============================= ")
Dim table As DataTable = SetupModifiedRows()
Dim reader As New DataTableReader(GetChangedCustomers())
AddHandler table.RowChanging, New _
DataRowChangeEventHandler(AddressOf HandleRowChanging)
table.Load(reader, optionForLoad)
Console.WriteLine()
DisplayRowState(table)
End Sub
Private Sub PrintColumns( _
ByVal table As DataTable)
' Loop through all the rows in the DataTableReader.
For Each row As DataRow In table.Rows
For Each col As DataColumn In table.Columns
Console.Write(row(col).ToString() & " ")
Console.WriteLine()
End Sub
Private Function SetupModifiedRows() As DataTable
' Fill a DataTable with customer info, and
' then modify, delete, and add rows.
Dim table As DataTable = GetCustomers()
' Row 0 is unmodified.
' Row 1 is modified.
' Row 2 is deleted.
' Row 3 is added.
table.Rows(1)("Name") = "Sydney"
table.Rows(2).Delete()
Dim row As DataRow = table.NewRow
row("ID") = 3
row("Name") = "Melony"
table.Rows.Add(row)
' Note that the code doesn't call
' table.AcceptChanges()
Return table
End Function
Private Sub HandleRowChanging(ByVal sender As Object, _
ByVal e As System.Data.DataRowChangeEventArgs)
Console.WriteLine( _
"RowChanging event: ID = {0}, action = {1}", e.Row("ID"), e.Action)
End Sub
方法
Load
會取用載入
IDataReader
的第一個結果集,並在成功完成之後,將讀取器的位置設定為下一個結果集。 轉換資料時,
Load
方法會使用與 方法相同的轉換規則
Fill
。
從實例載入資料時,方法
Load
必須考慮三個
IDataReader
特定問題:架構、資料和事件作業。 使用架構時,
Load
方法可能會遇到如下表中所述的條件。 所有匯入的結果集都會進行架構作業,即使是不包含任何資料的集合。
架構相容,但載入的結果集架構包含 中不存在
DataTable
的資料行。
方法
Load
會將額外的資料行新增至
DataTable
的架構。 如果 中
DataTable
對應的資料行和載入的結果集與值不相容,方法會擲回例外狀況。 方法也會從所有新增資料行的結果集中擷取條件約束資訊。 除了主鍵條件約束的情況之外,只有在目前
DataTable
未在載入作業開始時包含任何資料行時,才會使用此條件約束資訊。
架構相容,但載入的結果集架構包含的資料行少於
DataTable
。
如果遺漏的資料行具有已定義的預設值,或資料行的資料類型可為 Null,
Load
則方法允許加入資料列,並取代遺漏資料行的預設或 Null 值。 如果沒有可以使用預設值或 Null,則
Load
方法會擲回例外狀況。 如果未提供任何特定的預設值,此方法會
Load
使用 Null 值做為隱含的預設值。
在考慮方法在資料作業方面的行為
Load
之前,請考慮 中的每個
DataTable
資料列都會維護每個資料行的目前值和原始值。 這些值可能相等,或者如果資料列中的資料在填滿
DataTable
之後已經變更,則這些值可能會不同。 如需詳細資訊,請參閱
資料列狀態和資料列版本
。
在此方法呼叫中,指定的
LoadOption
參數會影響傳入資料的處理。 Load 方法應該如何處理與現有資料列具有相同主鍵的載入資料列? 它應該修改目前的值、原始值或兩者? 這些問題等等是由 參數所
loadOption
控制。
如果現有的資料列和傳入資料列包含對應的主鍵值,則會使用目前的資料列狀態值來處理資料列,否則會被視為新資料列。
就事件作業而言,事件
RowChanging
會在變更每個資料列之前發生,而且
RowChanged
事件會在每個資料列變更之後發生。 在每個案例中,
Action
傳遞至事件處理常式之
DataRowChangeEventArgs
實例的 屬性都包含與事件相關聯之特定動作的相關資訊。 此動作值會根據載入作業之前的資料列狀態而有所不同。 在每個案例中,都會發生這兩個事件,而且每個事件的動作都相同。 動作可以套用至每個資料列的目前或原始版本,或兩者,視目前的資料列狀態而定。
下表顯示使用每個
LoadOption
值呼叫時 Load 方法的行為,也會顯示值如何與所載入資料列的資料列狀態互動。 最後一個資料列 (標示為「 (不存在) 」) 描述不符合任何現有資料列的連入資料列行為。 此表格中的每個儲存格都會描述資料列內欄位的目前和原始值,以及
DataRowState
方法完成後的值
Load
。
現有的 DataRowState
Upsert
OverwriteChanges
PreserveChanges (預設行為)
Current = < Incoming>
原始 = - < 無法使用>
狀態 = < 已新增>
RowAction = 變更
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
目前 = < 現有>
原始 = < 傳入>
State = < Modified>
RowAction = ChangeOriginal
Current = < Incoming>
原始 = < 現有>
State = < Modified>
RowAction = 變更
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
目前 = < 現有>
原始 = < 傳入>
State = < Modified>
RowAction =ChangeOriginal
(載入不會影響已刪除的資料列)
Current = ---
原始 = < 現有>
State = < Deleted>
(新增具有下列特性的新資料列)
Current = < Incoming>
原始 = < 無法使用>
狀態 = < 已新增>
RowAction = Add
復原刪除和
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
目前 = < 無法使用>
原始 = < 傳入>
State = < Deleted>
RowAction = ChangeOriginal
Current = < Incoming>
原始 = < 現有>
如果新值與現有值相同,則
狀態 = < 未變更>
RowAction = Nothing
Else
State = < Modified>
RowAction = 變更
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
Current = < Incoming>
原始 = < 無法使用>
狀態 = < 已新增>
RowAction = Add
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
中的
DataColumn
值可以透過使用 和 等
ReadOnly
AutoIncrement
屬性來限制。 方法
Load
會以與資料行屬性所定義的行為一致的方式來處理這類資料行。 上的
DataColumn
唯讀條件約束僅適用于記憶體中發生的變更。 方法
Load
會視需要覆寫唯讀資料行值。
如果您在呼叫
Load
方法時指定 OverwriteChanges 或 PreserveChanges 選項,則假設傳入的資料來自
DataTable
的主要資料來源,而 DataTable 會追蹤變更,而且可以將變更傳播回資料來源。 如果您選取 Upsert 選項,假設資料來自其中一個次要資料來源,例如仲介層元件所提供的資料,可能是由使用者改變。 在此情況下,假設意圖是從 中的
DataTable
一或多個資料來源匯總資料,然後或許會將資料傳播回主要資料來源。 參數
LoadOption
用於判斷要用於主鍵比較之資料列的特定版本。 下表提供詳細資料。
用於主鍵比較的 DataRow 版本
public:
virtual void Load(System::Data::IDataReader ^ reader, System::Data::LoadOption loadOption, System::Data::FillErrorEventHandler ^ errorHandler);
public virtual void Load (System.Data.IDataReader reader, System.Data.LoadOption loadOption, System.Data.FillErrorEventHandler? errorHandler);
public virtual void Load (System.Data.IDataReader reader, System.Data.LoadOption loadOption, System.Data.FillErrorEventHandler errorHandler);
abstract member Load : System.Data.IDataReader * System.Data.LoadOption * System.Data.FillErrorEventHandler -> unit
override this.Load : System.Data.IDataReader * System.Data.LoadOption * System.Data.FillErrorEventHandler -> unit
Public Overridable Sub Load (reader As IDataReader, loadOption As LoadOption, errorHandler As FillErrorEventHandler)
// Attempt to load data from a data reader in which
// the schema is incompatible with the current schema.
// If you use exception handling, you won't get the chance
// to examine each row, and each individual table,
// as the Load method progresses.
// By taking advantage of the FillErrorEventHandler delegate,
// you can interact with the Load process as an error occurs,
// attempting to fix the problem, or simply continuing or quitting
// the Load process:
DataTable table = GetIntegerTable();
DataTableReader reader = new DataTableReader(GetStringTable());
table.Load(reader, LoadOption.OverwriteChanges, FillErrorHandler);
Console.WriteLine("Press any key to continue.");
Console.ReadKey();
private static DataTable GetIntegerTable()
// Create sample Customers table, in order
// to demonstrate the behavior of the DataTableReader.
DataTable table = new DataTable();
// Create two columns, ID and Name.
DataColumn idColumn = table.Columns.Add("ID", typeof(int));
// Set the ID column as the primary key column.
table.PrimaryKey = new DataColumn[] { idColumn };
table.Rows.Add(new object[] { 4 });
table.Rows.Add(new object[] { 5 });
table.AcceptChanges();
return table;
private static DataTable GetStringTable()
// Create sample Customers table, in order
// to demonstrate the behavior of the DataTableReader.
DataTable table = new DataTable();
// Create two columns, ID and Name.
DataColumn idColumn = table.Columns.Add("ID", typeof(string));
// Set the ID column as the primary key column.
table.PrimaryKey = new DataColumn[] { idColumn };
table.Rows.Add(new object[] { "Mary" });
table.Rows.Add(new object[] { "Andy" });
table.Rows.Add(new object[] { "Peter" });
table.AcceptChanges();
return table;
static void FillErrorHandler(object sender, FillErrorEventArgs e)
// You can use the e.Errors value to determine exactly what
// went wrong.
if (e.Errors.GetType() == typeof(System.FormatException))
Console.WriteLine("Error when attempting to update the value: {0}",
e.Values[0]);
// Setting e.Continue to True tells the Load
// method to continue trying. Setting it to False
// indicates that an error has occurred, and the
// Load method raises the exception that got
// you here.
e.Continue = true;
Sub Main()
Dim table As New DataTable()
' Attempt to load data from a data reader in which
' the schema is incompatible with the current schema.
' If you use exception handling, you won't get the chance
' to examine each row, and each individual table,
' as the Load method progresses.
' By taking advantage of the FillErrorEventHandler delegate,
' you can interact with the Load process as an error occurs,
' attempting to fix the problem, or simply continuing or quitting
' the Load process:
table = GetIntegerTable()
Dim reader As New DataTableReader(GetStringTable())
table.Load(reader, LoadOption.OverwriteChanges, _
AddressOf FillErrorHandler)
Console.WriteLine("Press any key to continue.")
Console.ReadKey()
End Sub
Private Sub FillErrorHandler(ByVal sender As Object, _
ByVal e As FillErrorEventArgs)
' You can use the e.Errors value to determine exactly what
' went wrong.
If e.Errors.GetType Is GetType(System.FormatException) Then
Console.WriteLine("Error when attempting to update the value: {0}", _
e.Values(0))
End If
' Setting e.Continue to True tells the Load
' method to continue trying. Setting it to False
' indicates that an error has occurred, and the
' Load method raises the exception that got
' you here.
e.Continue = True
End Sub
Private Function GetIntegerTable() As DataTable
' Create sample table with a single Int32 column.
Dim table As New DataTable
Dim idColumn As DataColumn = table.Columns.Add("ID", GetType(Integer))
' Set the ID column as the primary key column.
table.PrimaryKey = New DataColumn() {idColumn}
table.Rows.Add(New Object() {4})
table.Rows.Add(New Object() {5})
table.TableName = "IntegerTable"
table.AcceptChanges()
Return table
End Function
Private Function GetStringTable() As DataTable
' Create sample table with a single String column.
Dim table As New DataTable
Dim idColumn As DataColumn = table.Columns.Add("ID", _
GetType(String))
' Set the ID column as the primary key column.
table.PrimaryKey = New DataColumn() {idColumn}
table.Rows.Add(New Object() {"Mary"})
table.Rows.Add(New Object() {"Andy"})
table.Rows.Add(New Object() {"Peter"})
table.AcceptChanges()
Return table
End Function
Private Sub PrintColumns( _
ByVal table As DataTable)
' Loop through all the rows in the DataTableReader.
For Each row As DataRow In table.Rows
For Each col As DataColumn In table.Columns
Console.Write(row(col).ToString() & " ")
Console.WriteLine()
End Sub
方法
Load
會取用載入
IDataReader
的第一個結果集,並在成功完成之後,將讀取器的位置設定為下一個結果集。 轉換資料時,
Load
方法會使用與 方法相同的轉換規則
DbDataAdapter.Fill
。
從實例載入資料時,方法
Load
必須考慮三個
IDataReader
特定問題:架構、資料和事件作業。 使用架構時,
Load
方法可能會遇到如下表中所述的條件。 所有匯入的結果集都會進行架構作業,即使是不包含任何資料的集合。
架構相容,但載入的結果集架構包含 中不存在
DataTable
的資料行。
方法
Load
會將額外的資料行 () 新增至
DataTable
的架構。 如果 中
DataTable
對應的資料行和載入的結果集與值不相容,方法會擲回例外狀況。 方法也會從所有新增資料行的結果集中擷取條件約束資訊。 除了主鍵條件約束的情況之外,只有在目前
DataTable
未在載入作業開始時包含任何資料行時,才會使用此條件約束資訊。
架構相容,但載入的結果集架構包含的資料行少於
DataTable
。
如果遺漏的資料行具有已定義的預設值,或資料行的資料類型可為 Null,
Load
則方法允許加入資料列,並取代遺漏資料行的預設或 Null 值。 如果沒有可以使用預設值或 Null,則
Load
方法會擲回例外狀況。 如果未提供任何特定的預設值,此方法會
Load
使用 Null 值做為隱含的預設值。
在考慮方法在資料作業方面的行為
Load
之前,請考慮 中的每個
DataTable
資料列都會維護每個資料行的目前值和原始值。 這些值可能相等,或者如果資料列中的資料在填滿
DataTable
之後已經變更,則這些值可能會不同。 如需詳細資訊,請參閱
資料列狀態和資料列版本
。
在此方法呼叫中,指定的
LoadOption
參數會影響傳入資料的處理。 Load 方法應該如何處理與現有資料列具有相同主鍵的載入資料列? 它應該修改目前的值、原始值或兩者? 這些問題等等是由 參數所
loadOption
控制。
如果現有的資料列和傳入資料列包含對應的主鍵值,則會使用目前的資料列狀態值來處理資料列,否則會被視為新資料列。
就事件作業而言,事件
RowChanging
會在變更每個資料列之前發生,而且
RowChanged
事件會在每個資料列變更之後發生。 在每個案例中,
Action
傳遞至事件處理常式之
DataRowChangeEventArgs
實例的 屬性都包含與事件相關聯之特定動作的相關資訊。 此動作值會根據載入作業之前的資料列狀態而有所不同。 在每個案例中,都會發生這兩個事件,而且每個事件的動作都相同。 動作可以套用至每個資料列的目前或原始版本,或兩者,視目前的資料列狀態而定。
下表顯示使用每個
LoadOption
值呼叫時 Load 方法的行為,也會顯示值如何與所載入資料列的資料列狀態互動。 最後一個資料列 (標示為「 (不存在) 」) 描述不符合任何現有資料列的連入資料列行為。 此表格中的每個儲存格都會描述資料列內欄位的目前和原始值,以及
DataRowState
方法完成後的值
Load
。
現有的 DataRowState
Upsert
OverwriteChanges
PreserveChanges (預設行為)
Current = < Incoming>
原始 = - < 無法使用>
狀態 = < 已新增>
RowAction = 變更
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
目前 = < 現有>
原始 = < 傳入>
State = < Modified>
RowAction = ChangeOriginal
Current = < Incoming>
原始 = < 現有>
State = < Modified>
RowAction = 變更
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
目前 = < 現有>
原始 = < 傳入>
State = < Modified>
RowAction =ChangeOriginal
eleted
(載入不會影響已刪除的資料列)
Current = ---
原始 = < 現有>
State = < Deleted>
(新增具有下列特性的新資料列)
Current = < Incoming>
原始 = < 無法使用>
狀態 = < 已新增>
RowAction = Add
復原刪除和
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
目前 = < 無法使用>
原始 = < 傳入>
State = < Deleted>
RowAction = ChangeOriginal
Current = < Incoming>
原始 = < 現有>
如果新值與現有值相同,則
狀態 = < 未變更>
RowAction = Nothing
Else
State = < Modified>
RowAction = 變更
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
Current = < Incoming>
原始 = < 無法使用>
狀態 = < 已新增>
RowAction = Add
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
Current = < Incoming>
原始 = < 傳入>
狀態 = < 未變更>
RowAction = ChangeCurrentAndOriginal
中的
DataColumn
值可以透過使用 和 等
ReadOnly
AutoIncrement
屬性來限制。 方法
Load
會以與資料行屬性所定義的行為一致的方式來處理這類資料行。 上的
DataColumn
唯讀條件約束僅適用于記憶體中發生的變更。 方法
Load
會視需要覆寫唯讀資料行值。
如果您在呼叫
Load
方法時指定 OverwriteChanges 或 PreserveChanges 選項,則假設傳入的資料來自
DataTable
的主要資料來源,而 DataTable 會追蹤變更,而且可以將變更傳播回資料來源。 如果您選取 Upsert 選項,假設資料來自其中一個次要資料來源,例如仲介層元件所提供的資料,可能是由使用者改變。 在此情況下,假設意圖是從 中的
DataTable
一或多個資料來源匯總資料,然後或許會將資料傳播回主要資料來源。 參數
LoadOption
用於判斷要用於主鍵比較之資料列的特定版本。 下表提供詳細資料。
用於主鍵比較的 DataRow 版本
參數
errorHandler
是委派
FillErrorEventHandler
,參考載入資料時發生錯誤時所呼叫的程式。
FillErrorEventArgs
傳遞至程式的參數提供屬性,可讓您擷取所發生錯誤的相關資訊、目前的資料列,以及
DataTable
所填入的資訊。 使用此委派機制,而不是更簡單的 try/catch 區塊,可讓您判斷錯誤、處理情況,並視需要繼續處理。 參數
FillErrorEventArgs
會
Continue
提供屬性:將此屬性設定為
true
,表示您已處理錯誤,並想要繼續處理。 將 屬性設定為
false
,表示您想要停止處理。 請注意,將 屬性設定為
false
會導致觸發問題的程式碼擲回例外狀況。