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.1304.0)

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


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

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