BindingSource 元件
更新:2007 年 11 月
封裝資料來源以繫結至控制項。
BindingSource 元件有兩個用途。第一,它會在表單上的控制項繫結至資料時,提供間接取值 (Indirection) 層。這項作業的完成,是透過將 BindingSource 元件繫結至資料來源,然後將表單上的控制項繫結至 BindingSource 元件。所有與資料的進一步互動 (包括巡覽、排序、篩選和更新) 都會透過呼叫 BindingSource 元件來完成。
第二,BindingSource 元件可以當做強型別 (Strongly Typed) 的資料來源。使用 Add 方法將某個型別加入 BindingSource 元件,會建立該型別的清單。
在本節中
BindingSource 元件概觀
簡介 BindingSource 元件的一般概念,這個元件允許您將資料來源繫結至控制項。HOW TO:將 Windows Form 控制項繫結至 DBNull 資料庫數值
示範如何使用 BindingSource 元件,處理來自資料來源的 DBNull 值。HOW TO:使用 Windows Form BindingSource 元件排序和篩選 ADO.NET 資料
示範使用 BindingSource 元件,對顯示的資料套用排序和篩選器。HOW TO:使用 Windows Form BindingSource 繫結至 Web 服務
示範如何使用 BindingSource 元件,繫結至 Web 服務。HOW TO:處理資料繫結時所發生的錯誤和例外狀況
示範使用 BindingSource 元件,適當地處理資料繫結作業中的錯誤。HOW TO:將 Windows Form 控制項繫結至型別
示範使用 BindingSource 元件,繫結至型別。HOW TO:將 Windows Form 控制項繫結至 Factory 物件
示範使用 BindingSource 元件,繫結至 Factory 物件或方法。HOW TO:使用 Windows Form BindingSource 自訂加入項目
示範使用 BindingSource 元件,建立新的項目並將它們加入資料來源。HOW TO:使用 BindingSource ResetItem 方法引發變更通知
示範使用 BindingSource 元件,為不支援變更告知的資料來源引發變更告知事件。HOW TO:使用 BindingSource 和 INotifyPropertyChanged 介面引發變更告知
示範如何透過 BindingSource 控制項,使用繼承自 INotifyPropertyChanged 的型別。HOW TO:使用 BindingSource 反映 Windows Form 控制項中的資料來源更新
示範如何使用 BindingSource 元件,回應資料來源的變更。HOW TO:使用 BindingSource 元件跨表單共用繫結資料
顯示如何使用 BindingSource 將多個表單繫結至同一個資料來源。
參考
BindingSource
提供 BindingSource 元件的參考文件。BindingNavigator
提供 BindingNavigator 控制項的參考文件。
相關章節
- Windows Form 資料繫結
包含描述 Windows Form 資料繫結架構的主題連結。