Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > .NET Parameter Direction affects datatype casting

Thread Tools

.NET Parameter Direction affects datatype casting

Posts: n/a

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* Removed)e;

But for the execution for the Update we need to use:
_lastModifiedDateTime = (sqlDatetime)cmdToExecute.Parame*
(E-Mail Removed)e;

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

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?
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Up casting and down casting Sosuke C++ 2 12-20-2009 03:24 PM
Problem with depracated casting method (down casting) Wally Barnes C++ 3 11-20-2008 05:33 AM
database datatype bit what is the C# datatype? Jeff ASP .Net 2 04-16-2007 08:26 PM
why browser cache setting affects program behavior? Fix? =?Utf-8?B?anVubGlh?= ASP .Net 2 05-20-2005 06:27 PM
Another question about inheritance (up-casting and down-casting) kevin Java 11 01-08-2005 07:11 PM