Delen via


Syntax error in cast operator; two arguments separated by comma are required

An expression uses the CType conversion function or the DirectCast or TryCast conversion keyword but supplies only one argument.

CType, DirectCast, and TryCast all require two arguments. The first is an expression to be converted and the second is the data type or class type to which to convert it.

Error ID: BC30944

To correct this error

  • Supply both arguments as required for the conversion.

  • If you intend to use one of the specific Type Conversion Functions such as CString, you must use that function name instead of CType. Then only one argument is required.

See Also

Reference

CType Function

DirectCast

TryCast

Type Conversion Functions