ObjectDataSourceView.OldValuesParameterFormatString 屬性

定義

取得或設定格式字串,套用至傳遞給 DeleteUpdate 方法之原始值的參數名稱。

public:
 property System::String ^ OldValuesParameterFormatString { System::String ^ get(); void set(System::String ^ value); };
public string OldValuesParameterFormatString { get; set; }
member this.OldValuesParameterFormatString : string with get, set
Public Property OldValuesParameterFormatString As String

屬性值

字串,表示套用至傳遞給 DeleteUpdate 方法之任何 oldValues 名稱的格式字串。 預設值為 「 {0} 」,這表示參數名稱只是功能變數名稱。

備註

格式 OldValuesParameterFormatString 字串只會套用至主鍵,例如使用資料系結控制項的 屬性識別,或在刪除和更新案例中識別 DataKeyNames ,其中 ConflictDetection 屬性會設定為 CompareAllValues 值,以及傳遞至對應資料方法的原始值集。

您可能會變更 OldValuesParameterFormatString 屬性的兩個常見案例如下:

  • 區分更新中的舊值和新值。 當 屬性 ConflictDetection 設定為 CompareAllValues 值時,原始值和新值的參數都會新增至 UpdateParameters 集合。 如果沒有格式化字串,系統會為每個資料欄位建立兩個具有相同名稱的參數。 藉由變更原始值參數的名稱,您可以將資料與原始資料來源進行比較,以偵測衝突並比較索引鍵值。

  • 某些視覺化設計工具會實作原始值和索引鍵的特定命名配置。

的值 OldValuesParameterFormatString 會儲存在檢視狀態中。

適用於

另請參閱