Export (0) Print
Expand All

DatabaseExtensions.ExecuteSprocAccessor<TResult> Method (Database, String, 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)

public static IEnumerable<TResult> ExecuteSprocAccessor<TResult>(
	this Database database,
	string procedureName,
	params Object[] parameterValues
)
where TResult : new()

Parameters

database
Type: Microsoft.Practices.EnterpriseLibrary.Data.Database
The Database that contains the stored procedure.
procedureName
Type: System.String
The name of the stored procedure that will be executed.
parameterValues
Type: System.Object[]
Parameter values passsed to the stored procedure.

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).
Show:
© 2015 Microsoft