Convert int64 datatype to int32 using vbnet?

1 answer

Answer

1146762

2026-08-09 00:55

+ Follow

In VB.NET, you can convert an Int64 (also known as Long) to Int32 (or Integer) using explicit casting. Here's an example:

<code class="language-vb.net">Dim longValue As Int64 = 12345678901234

Dim intValue As Int32 = CType(longValue, Int32)

</code>

Keep in mind that if the Int64 value exceeds the range of an Int32, it will lead to an OverflowException. Always ensure the value is within the valid range before performing the conversion.

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.