DatabaseExtensions.ExecuteSprocAccessor<TResult> Method (Database, String, array<Object[])

Executes a stored procedure 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) Version: 6.0.0.0 (6.0.1304.0)

Syntax

public static IEnumerable<TResult> ExecuteSprocAccessor<TResult>(
    this Database database,
    string procedureName,
    params Object[] parameterValues
)
where TResult : new()
'Declaration
<ExtensionAttribute> 
Public Shared Function ExecuteSprocAccessor(Of TResult As New) ( 
    database As Database,
    procedureName As String,
    ParamArray parameterValues As Object()
) As IEnumerable(Of TResult)
public:
[ExtensionAttribute]
generic<typename TResult>
where TResult : gcnew()
static IEnumerable<TResult>^ ExecuteSprocAccessor(
    Database^ database, 
    String^ procedureName, 
    ... array<Object^>^ parameterValues
)

Parameters

  • procedureName
    Type: System.String
    The name of the stored procedure that will be executed.
  • parameterValues
    Type: array<System.Object[]
    Parameter values passsed to the stored procedure.

Type Parameters

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

Return Value

Type: IEnumerable<TResult>
An enumerable of TResult.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Database. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also

DatabaseExtensions Class

DatabaseExtensions Members

ExecuteSprocAccessor Overload

Microsoft.Practices.EnterpriseLibrary.Data Namespace