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)

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: ListTCollections of object, type T.

Exception | Condition |
---|---|
ArgumentNullException | In case the SQL is null. |
SqlException | In case the underlying connection cause an exception. |

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.
