Hi, after migrating from “Windows Legacy” to “Windows” project in Uipath, I have a problem with connecting to our Sql database. There is an error with Sql Provider, which was previously working:
I have read that this connected with new .Net settings, so I’ve tried to import that namespace again and also, I have imported “Microsoft.Data.SqlClient”:
But after that, I’ve started to getting another error:
So I don’t know what is the problem here, no Sql settings were changed.
How can I overcome this error in new Studio projects, since I need to connect to our Database?
Create a new Connect to Database activity in the Windows project compatibility and use the Wizard to build again the Microsoft.Data.SqlClient connection.
Error message: “A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SNI_PN11, error: 26 - Error Locating Server/Instance Specified)”
Another thing that I’ve just noticed when checking console/output during the compilation, there was an error (which is not stopping the program to compile). I’m not sure what is means and how to solve it, but it seems, thats it is connected with sql activity somehow:
If not, it might be a good idea to clear the %userprofile%\.nuget\packages folder (or rename it for a moment) and allow Studio to redownload the dependencies. It could be that some dependencies were not downloaded correctly and that is causing you these headaches.
finally i have some time so i went back to the sql provider issue, I already deleted all the files in said folder (%userprofile%.nuget\packages), updated all packages in my libraries (windows project) but still with no luck.
I have some new tips - while compiling my libraries, I noticed the below errors, which I believe are related to this issue:
01/09/2023 16:14:17 => [Error] Bad IL format. The format of the file ‘C:\Users\piotr.gajewski.nuget\packages\UiPath.database.activities\1.7.1\lib/net5.0-windows7.0/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll’ is invalid.
01/09/2023 16:14:18 => [Error] Assembly with same name is already loaded
01/09/2023 16:14:18 => [Error] Assembly with same name is already loaded
01/09/2023 16:14:18 => [Error] Assembly with same name is already loaded
So there are 4 errors during the libraries compilation process and 1 note about unable to load dependencies. Any further help is greatly appreciated. Peter
Hi, so I installed Oracle drivers and also .Net 4.8 drivers but that did not solve the issue, the “Bad IL format” error still exists, however I was experimenting with Connection String and finally I found out that this was a problem!
I have used below pattern and it’s worked: “Data Source=IpAddress\optima,PortNumber;Initial Catalog=master;User ID=varDataUser;Password=varDataPassword;Trust Server Certificate=true”
where:
IpAddress is like: 192.xyz.x.xyz
PortNumber is like: 12345
varDataUser: User login
varDataPassword: User password
Last parameter was crucial: “Trust Server Certificate=true” as it was connected with SSL protocol, which by default was turned off in old UiPath activities but turned on in new (Windows projects) activities.