Can not figure out the problem with Execute query for SQL

Hi all,

I am trying to select data from a SQL database. For a test purpose I am using a simple select for one row output. I have followed the steps from the knowledge and was able to successfully connect to database. When I try to execute the query I get the following error message:
Execute query : This location is marked as const, so its value cannot be modified.

Error Message:
Main has thrown an exception

Source: Execute query

Message: This location is marked as const, so its value cannot be modified.

Exception Type: InvalidOperationException

System.InvalidOperationException: This location is marked as const, so its value cannot be modified.
at UiPath.Database.Activities.ExecuteQuery.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

Any help would be much appreciated.


@Tanya looks like you got issues in variable deceleration based on your error message.
If you could able to share your WF then i will try to help you.

Sure , what is wf?

Work Flow



@ddpadil @aksh1yadav guys could you please help Tanya

Hi , I am quite new to the forum and seeking help with an issue. I have posted my problem on the forum but so far I am not getting any help. I did my research for similar issue and found nothing on it except for one post with a similar error which also has no response on it, too. I completely understand that no one i obligated to respond. Can you pleas advise?

i just replied your question

Let me know if you need more information.

@ddpadil @aksh1yadav @rkelchuri

This was resolved by removing connect activity from my wf.
I set up connection directly in the execute query activity and it worked.