DatabaseExtensions.ExecuteSqlStringAccessor<TResult> Method (Database, String)

Executes a Transact-SQL query and returns the result as an enumerable of TResult. The conversion from IDataRecord to TResult will be done for each property based on matching property name to column name.

Namespace: Microsoft.Practices.EnterpriseLibrary.Data
Assembly: Microsoft.Practices.EnterpriseLibrary.Data (in Microsoft.Practices.EnterpriseLibrary.Data.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function ExecuteSqlStringAccessor(Of TResult As New) ( _
    database As Database, _
    sqlString As String _
) As IEnumerable(Of TResult)
public static IEnumerable<TResult> ExecuteSqlStringAccessor<TResult>(
    this Database database,
    string sqlString
)
where TResult : new()
[ExtensionAttribute]
public:
generic<typename TResult>
where TResult : gcnew()
static IEnumerable<TResult>^ ExecuteSqlStringAccessor(
    Database^ database, 
    String^ sqlString
)
JScript does not support generic types or methods.

Parameters

  • sqlString
    Type: System.String
    The Transact-SQL query that will be executed.

Type Parameters

  • TResult
    The element type that will be returned when executing.

Return Value

An enumerable of TResult.

See Also

DatabaseExtensions Class

ExecuteSqlStringAccessor<TResult> Overload

Microsoft.Practices.EnterpriseLibrary.Data Namespace