Subject | Parameter order to SP |
---|---|
Author | Tim Gahnström |
Post date | 2005-04-20T10:50:31Z |
I have searched the history of the list looking for more information on how to pass parameters to FireBird Stored Procedures from .NET because it is behaving weird I think but I didn't come up with anything good.
The way I do it now I like this:
---------
FbCommand("SELECT * FROM SP_GET_MOVIES_ALL(?,?)", con)
fc.CommandType = CommandType.Text
fc.Parameters.Add("ICOUNT", 0).Direction = ParameterDirection.Input
fc.Parameters.Add("ISTART", 2).Direction = ParameterDirection.Input
Dim fdr As FbDataReader = fc.ExecuteReader()
----------
This looks simple enough and works well as long as I ad the parameters in the right order. Why do I need to do that? When I pass the names along with parameter? And I have named the parameters in the SP.
I realize that the parameters need to be in order with a command like this:
FbCommand("SELECT * FROM SP_GET_MOVIES_ALL(1,2)", con)
But it seems strange that FB or the .NET dataprovider doesn't handle the named parameters "correct".
I am using
FB 1.5
With
.NET Dataprovider Version 1.7 RC 2
Have I misunderstood something or is this just a limitation?
Thanks
Tim
The way I do it now I like this:
---------
FbCommand("SELECT * FROM SP_GET_MOVIES_ALL(?,?)", con)
fc.CommandType = CommandType.Text
fc.Parameters.Add("ICOUNT", 0).Direction = ParameterDirection.Input
fc.Parameters.Add("ISTART", 2).Direction = ParameterDirection.Input
Dim fdr As FbDataReader = fc.ExecuteReader()
----------
This looks simple enough and works well as long as I ad the parameters in the right order. Why do I need to do that? When I pass the names along with parameter? And I have named the parameters in the SP.
I realize that the parameters need to be in order with a command like this:
FbCommand("SELECT * FROM SP_GET_MOVIES_ALL(1,2)", con)
But it seems strange that FB or the .NET dataprovider doesn't handle the named parameters "correct".
I am using
FB 1.5
With
.NET Dataprovider Version 1.7 RC 2
Have I misunderstood something or is this just a limitation?
Thanks
Tim