ErrorProvider.BindToDataAndErrors Method

Provides a method to set both the DataSource and DataMember at run time.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

Public Sub BindToDataAndErrors ( _
	newDataSource As Object, _
	newDataMember As String _
Dim instance As ErrorProvider
Dim newDataSource As Object
Dim newDataMember As String

instance.BindToDataAndErrors(newDataSource, newDataMember)
public void BindToDataAndErrors (
	Object newDataSource, 
	String newDataMember
public function BindToDataAndErrors (
	newDataSource : Object, 
	newDataMember : String
Not applicable.



A data set based on the IList interface to be monitored for errors. Typically, this is a DataSet to be monitored for errors.


A collection within the newDataSource to monitor for errors. Typically, this will be a DataTable.

To avoid conflicts at run time that can occur when changing DataSource and DataMember, you should use BindToDataAndErrors instead of setting DataSource and DataMember individually.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions