This is because there are not the types
in C#, and, in VB.NET, they can be the arrays of those integer values.
There are types
and a lot more. "Conversion" you need is done by assignment. This is because the set of values if the type
is a subset of that of the type
. You need type case to assign the value if
As to arrays of different numeric types, they cannot be assigned compatible at all. Do I need to explain what would happen if such cast would be possible?
(I explained it in more general terms of sets of values, not ranges
, because not all numeric types have ranges, floating-point types work differently and include Infinity and Not-a-Number values. Still, they have assignment compatibility rules. But integer types have ranges. "Range" is a bad, sloppy term which became a universally used computing jargon; correct term for set of values is "domain".)
are actually alias names for
. All numeric types have alias names, to make the code independent from the
See also this CodeProject article: Cheat Sheet - Casting in VB.NET and C#
What to do? Review the types of variables you use in your ASP.NET construct.