Binding.DataSource Właściwość

Definicja

Pobiera źródło danych dla tego powiązania.

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

Wartość właściwości

Object

Element Object reprezentujący źródło danych.

Przykłady

W poniższym przykładzie kodu użyto DataSource właściwości , aby zwrócić DataSetwartość .

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

Uwagi

Możliwe źródła danych obejmują:

Dotyczy