D
Davide
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 LastModifiedDateTime 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:
_lastModifiedDateTime = (DateTime)cmdToExecute.Parameter
(e-mail address removed);
But for the execution for the Update we need to use:
_lastModifiedDateTime = (sqlDatetime)cmdToExecute.Parame
(e-mail address removed);
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.Parameters.Add(new SqlParameter
("@daLastModifiedDat eTime", SqlDbType.DateTime, 8,
ParameterDirection.InputOutput, true, 23, 3, "",
DataRowVersion.Proposed, _lastModifiedDateTime));
cmdToExecute.Parameters.Add(new SqlParameter
("@daLastModifiedDat eTime", SqlDbType.DateTime, 8,
ParameterDirection.Output, true, 23, 3, "",
DataRowVersion.Proposed, _lastModifiedDateTime));
Is this the correct behaviour?
Is there something I am missing from
cmdToExecute.Parameters statments?
We have a stored procedure for inserting data into a
table and another for Updating that table.
For the Insert SP we use a LastModifiedDateTime 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:
_lastModifiedDateTime = (DateTime)cmdToExecute.Parameter
(e-mail address removed);
But for the execution for the Update we need to use:
_lastModifiedDateTime = (sqlDatetime)cmdToExecute.Parame
(e-mail address removed);
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.Parameters.Add(new SqlParameter
("@daLastModifiedDat eTime", SqlDbType.DateTime, 8,
ParameterDirection.InputOutput, true, 23, 3, "",
DataRowVersion.Proposed, _lastModifiedDateTime));
cmdToExecute.Parameters.Add(new SqlParameter
("@daLastModifiedDat eTime", SqlDbType.DateTime, 8,
ParameterDirection.Output, true, 23, 3, "",
DataRowVersion.Proposed, _lastModifiedDateTime));
Is this the correct behaviour?
Is there something I am missing from
cmdToExecute.Parameters statments?