tshad wrote:
In VS 2008, why can I not do:
trace.warn("parameters(3) = " & parameters(3).value)
I get an error:
Option Strict on prohibits operands of type Object for operator '&'
This worked fine in 2003.
parameters is defined as:
Dim parameters As SqlParameter() = { _
New SqlParameter("@ScreenQuestionID", SqldbType.Int), _
...
Thanks,
Tom
Because the Value property of the SqlParameter class is of the type Object.
You can cast the object to the actual type that you have stored in the
parameter, the & operator will then use the ToString method to format it
into a string:
trace.warn("parameters(3) = " & DirectCast(parameters(3).Value, Integer))
Or you can simply use the ToString method on the object to get the
string representation:
trace.warn("parameters(3) = " & parameters(3).Value.ToString())
--
Göran Andersson
_____
http://www.guffa.com