Hi,
I have just finished converted a vb.net app to c# and one of the lines is to get @ReturnValue from the parameter.
I ended up having to CAST a lot of things..
Is there not a easier way
here is what i have
int rc = ((System.Data.SqlTypes.SqlInt32)(((System.Data.SqlClient.SqlParameter)(cmd.Parameters["@ReturnValue"])).SqlValue)).Value;
In vb.net it was as simple as doing this
Dim rc As Integer = Convert.ToInt32(cmd.Parameters("@ReturnValue").Value)
Alot easier :-)
But the problem with C# is the property Value isn't available unless I Cast to SqlParameter and i also need to cast to Sqltypes.SqlInt32 - i can't just do a standard Convert.ToInt32