This is in Web Studio. I am trying to reproduce a running automation from the standalone client in the cloud. I am creating a “Microsoft.Data.SqlClient” connection and then attempting to run a SQL query with it and every time I do get this error at the SQL step:
2025-03-12 16:28:05.968 GMT−4: Error: System.ArgumentException: Only one of the connections can be used.
at UiPath.Database.Activities.ExecuteQuery.HandleException(Exception ex, Boolean continueOnError)
at UiPath.Database.Activities.ExecuteQuery.ExecuteInternalAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
at UiPath.Database.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
I am testing on my local machine and I can connect to the server in question via SQL Server Management Studio and run this same query. I have no DSNs defined for this database anywhere and have closed out any possible connections to the server like SSMS.
The connection string is:
Data Source={myServer};Initial Catalog={databasename};Integrated Security=True;Encrypt=False
And the creates a “Database connection” object
I then created a DatabaseConnection-typed variable with a default value of “new UiPath.Database.DatabaseConnection” and used that as my “Existing connection” value.
There is only one connection defined. If I put a disconnect command after the connect, the disconnect runs fine. It’s only the SQL that fails.
Anyone run into this and know how to resolve it or is this a bug?