SqlCommandBuilder.DeriveParameters returns InputOutput for Output

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, I'm using .NET Framework 1.1 and SQL Server 2000.
I have a few "select" stored procedure that each contain a single OUTPUT
parameter in addition to the typical return parameter. When I use
SqlCommandBuilder.DeriveParameters, to dynamically populate the parameters in
my select command, the _direction of the OUTPUT parameter is returned as
"InputOutput" instead of "Output", which causes errors when I try to run the
command (i.e. when doing a fill) since an input parameter is expected.

What could be causing this to happen, and is there another solution short of
hard-coding the parameters?
 
You'd be better off hard coding the parameters and setting the
input/output information explicitly. DeriveParameters wastes an extra
round trip to the database.

--Mary
 
The CommandBuilder uses a stored procedure that never has been able to tell
the difference between the output and input-output parameters or determine
the precision/scale for floats. Yes, you're better off coding these
yourself. It's also faster at runtime (as others have said).

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
This kind of response is exactly why I prefer working in languages like Python, where people obey the principles of Laziness, Impatience, and Hubris. Complacency and tradition defines the ASP.NET community, with few exceptions (Ayende comes to mind)
 
Back
Top