Non-invocable member cannot be used like a method

Hi everyone, have error “Non-invocable member cannot be used like a method” when trying to get value from DataRow column. Looks really strange because compiler suggests this method firstly(1 screenshot), than give this error(secong screenshot). Maybe somebody knows where is the problem?
See screen below
P.S. working with ForEachDataRow cycle

noinvokable

Did u get the solution for the error?

Hi @dariya.ashchepkova
Instead of row() use row[“Column Name”].ToString() OR row[Column number].ToString()

9 Likes

Can you please explain why we are getting this type error?

Thanks a lot .this solution is used and my error getting solved

how to handle this error please let me know

Difference between VB-based and C#-based projects I think

1 Like

I also had the following error in my C# Project:

Non-invocable member ‘DataTable.Columns’ cannot be used like a method.

For a C# Project, I solved this by using the following case sensitive syntax:

UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(excelData.Columns[“Comparison_Inputs”].Ordinal + 1)

For a VB project, I use the following case insensitive syntax:

UiPath.Excel.Helpers.ExcelUtilities.ConvertColumnIndexToColumnLetter(excelData.Columns(“Comparision_Inputs”).Ordinal + 1)

As pointed out by @Keegan_Kosasih, the difference is the square brackets i.e. [ ] are used for the C# project type while parenthesis i.e. ( ) are used for the VB Project type.

Additional Information:
For the C# project, using an incorrect case syntax (e.g. UiPath, UiPath, etc.) will result in the following validation error message:

The name ‘UiPath’ does not exist in the current context

2 Likes

it’s the difference between vb and c# based process.

Try the following": row[“columnName”].toString()

yes, it helped as the diff is based on the braces {,()}used.

1 Like