DataSource.ExecuteObjects(T) Method

System.Data.Generic

DataSourceExecuteObjectsT Method
Executes the query, and returns a collection of object by the type T.

Namespace: System.Data.Generic
Assembly: System.Data.Generic (in System.Data.Generic.dll) Version: 1.9.5473.30542 (1.9.5473.2392)
Syntax
public List<T> ExecuteObjects<T>(
	string SQL
)
where T : class
Public Function ExecuteObjects(Of T As Class) ( 
	SQL As String
) As List(Of T)
public:
generic<typename T>
where T : ref class
List<T>^ ExecuteObjects(
	String^ SQL
)
member ExecuteObjects : 
        SQL : string -> List<'T>  when 'T : not struct

Parameters

SQL
Type: SystemString
SQL statement to execute.

Type Parameters

T
Type to return in list. This must be a managed object.

Return Value

Type: ListT
Collections of object, type T.
Exceptions
ExceptionCondition
ArgumentNullExceptionIn case the SQL is null.
SqlExceptionIn case the underlying connection cause an exception.
Remarks
ExecuteObjects does not support standardized types, as reflection is reversed. This methods tries to match properties of the T type to the data source. Use ExecuteList or ExecuteDictionary.
See Also