J
Jim Bancroft
Hi everyone,
I'm having some trouble with the code below. I receive a compile-time
error on the second line saying "; expected":
private static void myTestFunction(long myLong)
{
System.Data.SqlTypes.SqlInt32 myTestInt;
myTestInt= (System.Type.GetType("System.Int32")) myLong;
}
However, when I put the actual type in parens, it works fine:
private static void myTestFunction(long myLong)
{
System.Data.SqlTypes.SqlInt32 myTestInt;
myTestInt= (System.Int32) myLong;
}
Would anyone know offhand what I'm doing wrong? I thought the GetType
method would do the trick here, but I'm not an expert on casting and the
GetType method.
I'm having some trouble with the code below. I receive a compile-time
error on the second line saying "; expected":
private static void myTestFunction(long myLong)
{
System.Data.SqlTypes.SqlInt32 myTestInt;
myTestInt= (System.Type.GetType("System.Int32")) myLong;
}
However, when I put the actual type in parens, it works fine:
private static void myTestFunction(long myLong)
{
System.Data.SqlTypes.SqlInt32 myTestInt;
myTestInt= (System.Int32) myLong;
}
Would anyone know offhand what I'm doing wrong? I thought the GetType
method would do the trick here, but I'm not an expert on casting and the
GetType method.