First, I am using the Enterprise Library DatabaseFactory to get a Database
object. I have traced the issue down to the SqlCommandBuilder
DeriveParameters method.

Given a stored procedure args:

CREATE PROCEDURE UpdDept
( @KeyDepartmentIdentifier UNIQUEIDENTIFIER,
@KEYTimestamp BINARY(8),
@NewName NVARCHAR(50),
:
:
@OutTimeStamp BINARY(8)
)

Wheh I call the Database.DiscoverParameters (aka -
SqlCommandBuilder.DeriveParameters) the @OutTimeStamp DbPArameter
(SqlParameter) has its direction set to InputOutput.

SQL procedure parameters are either input or output. InputOut is not
defined (SQL 2005).

Why is the direction set to InputOutput?

This requires that I initialize the output parameter.

JM

RE: SqlCommandBuilder DeriveParameters Ouput Arg gets wrong direction by JM

JM
Fri Apr 18 14:22:00 CDT 2008

Sorry the parameters should have read:

CREATE PROCEDURE UpdDept
( @KeyDepartmentIdentifier UNIQUEIDENTIFIER,
@KEYTimestamp BINARY(8),
@NewName NVARCHAR(50),
:
:
@OutTimeStamp BINARY(8) OUTOUT


Re: SqlCommandBuilder DeriveParameters Ouput Arg gets wrong direction by William

William
Fri Apr 18 17:05:38 CDT 2008

This is an age-old problem with the interfaces to SQL Server providers. They
cannot discriminate between OUTPUT and Input/output parameters. You'll have
to hard-code these direction properties by hand.

--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhikerâ??s Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
"JM" <JM@discussions.microsoft.com> wrote in message
news:604AC7D7-5E9B-4FA9-83F4-48D0E5B1D54D@microsoft.com...
> First, I am using the Enterprise Library DatabaseFactory to get a Database
> object. I have traced the issue down to the SqlCommandBuilder
> DeriveParameters method.
>
> Given a stored procedure args:
>
> CREATE PROCEDURE UpdDept
> ( @KeyDepartmentIdentifier UNIQUEIDENTIFIER,
> @KEYTimestamp BINARY(8),
> @NewName NVARCHAR(50),
> :
> :
> @OutTimeStamp BINARY(8)
> )
>
> Wheh I call the Database.DiscoverParameters (aka -
> SqlCommandBuilder.DeriveParameters) the @OutTimeStamp DbPArameter
> (SqlParameter) has its direction set to InputOutput.
>
> SQL procedure parameters are either input or output. InputOut is not
> defined (SQL 2005).
>
> Why is the direction set to InputOutput?
>
> This requires that I initialize the output parameter.
>
> JM
>