Hello all,
We are having a problem calling stored procedures from a Visual Studio entity data model when using the Sybase ASE ADO.Net data provider.
The problem is that the value of any output parameters of the stored proc are not populated.
Here is an example in C# of how we call the stored procedure:
using (var context = new [DbContextType]()) { var outputParameter = new ObjectParameter("result", typeof(int)); var inputParameter = new ObjectParameter("input", 10); ((IObjectContextAdapter)context).ObjectContext.ExecuteFunction("square_value", inputParameter, outputParameter); Console.WriteLine("Result>{0}", outputParameter.Value); }
This example assumes an entity model has been created in Visual Studio and that the relevant stored procedure exists in the database. In this case the proc simply squares the input value and returns the result with an output parameter:
create proc square_value @input int, @result int output as select @result = @input * @input
In the example above, the value of "outputParameter.Value" should be 100. Although we are able to call the stored procedure using Sybase ASE ADO.Net, the output parameter value remains null.
We have managed to use output parameters in our example with alternative ADO.Net providers Microsoft (MS SQL Server database) and Progress DataDirect (Sybase ASE database).
The following info about our systems may be helpful:
Database: Sybase ASE Version 15.5
Sybase ADO.Net Data Provider (installed via SDK 15.5)
Entity Framework 4.1
Visual Studio 2010 Professional
Please let us know if output parameters are supported.
Thank you in advance