Export (0) Print
Expand All

ObjectContext.ExecuteFunction Method (String, ObjectParameter[])

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)

public int ExecuteFunction(
	string functionName,
	params ObjectParameter[] parameters
)

Parameters

functionName
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.
parameters
Type: System.Data.Objects.ObjectParameter[]
An array of ObjectParameter objects.

Return Value

Type: System.Int32
The number of rows affected.

ExceptionCondition
ArgumentException

function is null or empty

-or-

function is not found.

InvalidOperationException

The entity reader does not support this function.

-or-

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

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft