System.Data.Generic
DataSourceExecuteListT Method |
Executes the query, and returns a collection of the first column.
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> ExecuteList<T>( string SQL ) where T : class
Public Function ExecuteList(Of T As Class) ( SQL As String ) As List(Of T)
public: generic<typename T> where T : ref class List<T>^ ExecuteList( String^ SQL )
member ExecuteList : SQL : string -> List<'T> when 'T : not struct
Parameters
- SQL
- Type: SystemString
SQL statement to execute.
Type Parameters
- T
- Type of the first column.
Return Value
Type: ListTList of first column

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

Specifying a SQL statement with multiple columns will not change the output. Only the first column will be returned.
