I Used below code using Linq:
io_monthlyrollDT.Select(“3/31/2021=‘#N/A’”).ToList().ForEach(Sub(row) row(“3/31/2021”)=“0.00”)
I am getting error like this:
RemoteException wrapping System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> RemoteException wrapping System.Data.SyntaxErrorException: Syntax error: Missing operand after ‘’‘’ operator.
at System.Data.ExpressionParser.Parse()
at System.Data.DataExpression…ctor(DataTable table, String expression, Type type)
at System.Data.DataTable.Select(String filterExpression)
at UiPathCodeRunner_b3058715d7b44cdea69f4c763d8e793d.Run(DataTable& io_monthlyrollDT)
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object providedArgs, ParameterModifier modifiers, CultureInfo culture, String namedParams)
at UiPath.Activities.System.Utilities.InvokeCode.CompilerRunner.Run(Object args)
at UiPath.Activities.System.Utilities.InvokeCode.NetCodeInvoker.Run(String userCode, List1 inArgs, IEnumerable1 imps, Object args)
at UiPath.Core.Activities.InvokeCode.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
I am getting the below error if i am using this query.
dt.AsEnumerable.Where(Function(row) String.IsNullOrWhiteSpace(row(“3/31/2021”).ToString.Trim)).ToList().ForEach(Sub(row) row(“3/31/2021”)=“0.00”)
RemoteException wrapping System.ArgumentException: Column ‘3/31/2021’ does not belong to table DataTable.
Thanks for replying, i have used with index, i am not getting any error but upadate is not happening.
May i know how this value is getting filtered. #N/A.
please find the query which is used in invoke code.
io_dt.AsEnumerable.Where(Function(row) String.IsNullOrWhiteSpace(row(7).ToString.Trim)).ToList().ForEach(Sub(row) row(7)=“0.00”)
please find the attached snipet for reference after running with index.
If you are using Invoke Code for the expression then make sure that your datatable argument is in/out and make sure you are passing the same datatable variable to write range activity
Still it is not updating then better share your xaml file with project.json file