Binding.DataSource Binding.DataSource Binding.DataSource Binding.DataSource Property

定义

获取该绑定的数据源。Gets the data source for this binding.

public:
 property System::Object ^ DataSource { System::Object ^ get(); };
public object DataSource { get; }
member this.DataSource : obj
Public ReadOnly Property DataSource As Object

属性值

表示数据源的 ObjectAn Object that represents the data source.

示例

下面的代码示例使用DataSource属性DataSet返回。The following code example uses the DataSource property to return a DataSet.

private:
   void GetDataSource()
   {
      DataSet^ ds = dynamic_cast<DataSet^>(text1->DataBindings[nullptr]->DataSource);
      Console::WriteLine( ds->Tables[ 0 ]->TableName );
   }

private void GetDataSource()
{
   DataSet ds = (DataSet) text1.DataBindings[0].DataSource;
   Console.WriteLine(ds.Tables[0].TableName); 
}

Private Sub GetDataSource
	Dim ds As DataSet = CType(text1.DataBindings(0).DataSource, DataSet)
	Console.WriteLine(ds.Tables(0).TableName)
End Sub

注解

可能的数据源包括:Possible data sources include:

适用于