Hi guys, I have the following task at hand I need to get all the users and their pass and DB from a certain SQL DataBase and from there assign them to different arrays.
However the issue seems to be that some of the values in the “db” field appear to set to NULL and I get the below error:
“”“”
20.3.0-beta.84+Branch.release-v20.3.0.Sha.7fc79beda33f6ae9c6f407946cf052a16a3d7a0e
Source: Assign
Message: Object reference not set to an instance of an object.
Exception Type: System.NullReferenceException
RemoteException wrapping System.NullReferenceException: Object reference not set to an instance of an object.
at lambda_method(Closure , DataRow )
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() at System.Linq.Buffer
1…ctor(IEnumerable1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable
1 source)
at lambda_method(Closure , ActivityContext )
at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context) at System.Activities.CodeActivity
1.InternalExecuteInResolutionContext(CodeActivityContext context)
at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity) at System.Activities.InArgument
1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor)
at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath)
at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides, Location resultLocation, Boolean isDynamicUpdate) at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor, IDictionary
2 argumentValueOverrides, Location resultLocation, Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
“”"
Furthermore I changed the NULL values to 0 or null (with lowercase) and it stops giving me that message, however I am allowed to do this for debugging purposes so at production time I would not be able to mess around with the Data Base values.
So any advise how to add the NULL value to my array ? At the moment I am using an “Assign” activity to do this and the expression which I am using is “Users.AsEnumerable().Select(Function (a) a.Field(of string)(“db”).ToString).ToArray()”
Also on a side note is there a way to filter an array so it does not include certain users and assign that to a new array ?
Thank you very much