DesignTimeData.GetSelectedDataSource Method

Definition

Gets a data source selected by name in the design host, represented by the specified component's site property.

Overloads

GetSelectedDataSource(IComponent, String)

Gets a data source selected by name in the design host, represented by the specified component's site property and identified by the specified data source name.

GetSelectedDataSource(IComponent, String, String)

Gets a data source selected by name in the design host, represented by the specified component's site property and identified by the specified data-source name and member name.

GetSelectedDataSource(IComponent, String)

Gets a data source selected by name in the design host, represented by the specified component's site property and identified by the specified data source name.

C#
public static object GetSelectedDataSource(System.ComponentModel.IComponent component, string dataSource);

Parameters

component
IComponent

The IComponent object that contains the data source.

dataSource
String

The name of the data source to retrieve.

Returns

An object implementing either IListSource or IEnumerable representing the selected data source, or null if the data source or the designer host could not be accessed.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

GetSelectedDataSource(IComponent, String, String)

Gets a data source selected by name in the design host, represented by the specified component's site property and identified by the specified data-source name and member name.

C#
public static System.Collections.IEnumerable GetSelectedDataSource(System.ComponentModel.IComponent component, string dataSource, string dataMember);

Parameters

component
IComponent

The object implementing IComponent that contains the data sourced property.

dataSource
String

The data source to retrieve.

dataMember
String

The data member to retrieve.

Returns

An object implementing IEnumerable containing the data member, or null if the data source, member, or component's site could not be accessed.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1