ObjectContext::ExecuteFunction Method (String^, array<ObjectParameter^>^)

.NET Framework (current version)

Executes a stored procedure or function that is defined in the data source and expressed in the conceptual model; discards any results returned from the function; and returns the number of rows affected by the execution.

Namespace:   System.Data.Objects
Assembly:  System.Data.Entity (in System.Data.Entity.dll)

int ExecuteFunction(
	String^ functionName,
	... array<ObjectParameter^>^ parameters


Type: System::String^

The name of the stored procedure or function. The name can include the container name, such as <Container Name>.<Function Name>. When the default container name is known, only the function name is required.

Type: array<System.Data.Objects::ObjectParameter^>^

An array of ObjectParameter objects.

Return Value

Type: System::Int32

The number of rows affected.

Exception Condition

function is null or empty


function is not found.


The entity reader does not support this function.


There is a type mismatch on the reader and the function.

.NET Framework
Available since 4.0
Return to top