Strange error message in the immediate window
Posted: Thu Jul 02, 2020 4:34 pm
Hello X#-Community,
I am using the immediate window in Visual Studio (2017 with Bandol 2.41) a lot for debugging. So I am thankful for the recent improvements like being able to use the X# syntax instead of C#.
But there are still some limiations. Many times I have to deal with DataTables and DataColumns from the .NET 2.0 System.Data namespace.
If I have a Row-Variable which is a DataRow-object and a ColumnName-variable which is the name of the column:
Row[ColumName]:GetType().Name
This should give me the type of the column value for example.
Instead I'll get this:
error CS0019: Der --Operator kann nicht auf Operanden vom Typ "string" und "int" angewendet werden.
This is strange because there is no -- involved.
If I use the column index instead there is no error (please see attached screen shot)
Kind regards,
Peter
I am using the immediate window in Visual Studio (2017 with Bandol 2.41) a lot for debugging. So I am thankful for the recent improvements like being able to use the X# syntax instead of C#.
But there are still some limiations. Many times I have to deal with DataTables and DataColumns from the .NET 2.0 System.Data namespace.
If I have a Row-Variable which is a DataRow-object and a ColumnName-variable which is the name of the column:
Row[ColumName]:GetType().Name
This should give me the type of the column value for example.
Instead I'll get this:
error CS0019: Der --Operator kann nicht auf Operanden vom Typ "string" und "int" angewendet werden.
This is strange because there is no -- involved.
If I use the column index instead there is no error (please see attached screen shot)
Kind regards,
Peter