SqlCommandBuilder.DeriveParameters returns InputOutput for Output

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?
 
M

Mary Chipman

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
 
W

William \(Bill\) Vaughn

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.
__________________________________
 
Joined
Sep 11, 2009
Messages
17
Reaction score
0
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top