Hi
We have a stored procedure for inserting data into a
table and another for Updating that table.
For the Insert SP we use a LastModifiedDat eTime output
parameter and for the Update SP we use the InputOutput
parameter direction.
When we execute the query the following line works for
the Insert:
_lastModifiedDa teTime = (DateTime)cmdTo Execute.Paramet er*
s@daLastModifie dDateTime.Value;
But for the execution for the Update we need to use:
_lastModifiedDa teTime = (sqlDatetime)cm dToExecute.Para me*
te**@daLastModi fiedDateTime.Va lue;
When checking the datavalue we have noticed that if we
use input or inputoutput as the parameter direction it
returns sqlDateTime as the datatye but when we use the
Ouput parameter direction it returns DateTime as the
datatype.
The lines we use are:
cmdToExecute.Pa rameters.Add(ne w * SqlParameter
("@daLastModifi edDat* eTime", SqlDbType.DateT ime, 8,
ParameterDirect ion.InputOutput , * true, 23, 3, "",
DataRowVersion. Proposed, _lastModifiedDa teTime));
cmdToExecute.Pa rameters.Add(ne w * SqlParameter
("@daLastModifi edDat* eTime", SqlDbType.DateT ime, 8,
ParameterDirect ion.Output, true, 23, 3, "",
DataRowVersion. Proposed, _lastModifiedDa teTime));
Is this the correct behaviour?
Is there something I am missing from
cmdToExecute.Pa rameters statments?