CType is a function used for explicit type conversion between various data types, while ToString is a method for converting an object to its string representation
but both seem similiar to each other but i usually use Ctype for convert.
Note : Correct me if i’m wrong because i’m not sure about use case which one is better.
Sorry for giving wrong solution
can you try this one? i think it should work because i try in my process and not showing error
If(IsDBNull(CurrentRow.Item(0)) OrElse String.IsNullOrEmpty(CurrentRow.Item(0).ToString()), “0”, CurrentRow.Item(0).ToString())
CurrentRow.Item(0) Refers to the first item (at index 0) in the CurrentRow object, which is a DataRow from a DataTable. This item type : Object.
IsDBNull(CurrentRow.Item(0)): The IsDBNull function checks if CurrentRow.Item(0) is a DBNull value or not. DBNull represents an uninitialized value or a nonexistent value in a database field. The function returns True if the value is DBNull, and False otherwise.
Definition :Uninitialized value: A value that hasn’t been assigned or set.
Nonexistent value: A value that is missing or not present.
and then for OrElse String.IsNullOrEmpty(CurrentRow.Item(0).ToString()) will be else if condition to check if value is null
so if value in object is null (Not “0”) it will get detected by DBNull or String.IsNullOrEmpty condition and then will returned value as “0” but if not will return the exactly value that we retrieved.
Could you maybe re-iterate on what is the error that you are currently facing ? Provide a Screenshot if not already provided, If provided do direct us to that screenshot.