This project is read-only.
1

Closed

Add support for OUT parameters

description

There is currently no support for output parameters with stored procedures in the processor class. The interface for the solution to this problem should be as close to native C# idioms as possible.
Closed Aug 4, 2010 at 11:18 PM by capn_midnight
available in the latest revision, not yet available in a release

comments

capn_midnight wrote Aug 4, 2010 at 11:17 PM

DONE!

wrote Aug 4, 2010 at 11:17 PM

wrote Aug 4, 2010 at 11:18 PM

capn_midnight wrote Aug 4, 2010 at 11:19 PM

Say you have a stored procedure that goes something like this

create procedure MyProc
  @a int output
as begin
  set nocount on;
  set @a = 5
end


Then with this very unpretty syntax, you can call it using SqlSiphon

[MappedMethod]
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.Synchronized)]
public void MyProc(ref int a)
{
var p = new object[]{a}; // packing it in an array means we're passing the array *address* by value, so the *array's* values can be modified
this.Execute(p); // dooooo it
a = (int)p[0]; // copy the modified value back out again
}

wrote Feb 2, 2013 at 2:08 AM

wrote May 13, 2013 at 7:11 PM