Microsoft.Data.SqlClient

I recently went back into my Community Edition UiPath Studio to work on a project that accesses and was successfully accessing a MariaDB/MySQL database. At the Connect to database activity I was greeted with the yellow framed message “This project uses the Windows-legacy compatibility which is being phased out and will no longer be available for new projects in the next Enterprise release. Convert to windows.” When I clicked “Convert to Windows”, and all of the scrolled processing was completed, I tried to run the project. A “Runtime execution error” appeared with the following message:

Source: Connect to database

Message: Could not load file or assembly ‘Microsoft.Data.Sq|Client, Version=4.1.0.0,
Culture= neutral, PublicKeyToken=23ec7fc2d6eaa4a5’ or one of its dependencies. The system
cannot find the file specified.

Exception Type: System.IO.FileNotFoundException

What does this mean and how do I get my Database connection to work again?

Thanks in advance, Bill

Hi @bvasu

Just to clarify, please refer to this post as far as support for existing legacy workflows are concerned:

This means that if you do struggle with the conversion, it is best to stick to the legacy workflow for now.

Also, the default conversion is making a copy of your project, so you should be able to easily go back to your old project :slight_smile:

Now, as to the issue - could you please let us know the version of your Database package? Is this the latest 1.7.1 version? If not, does updating it helps to resolve this issue?

To debug things a bit more - does adding a new Connect to Database activity and configuring it from scratch help you resolve the issue?

Hi Maciej,

Yes, I am using version 1.7.1 of the Database package.

My connection string (which worked before) is “Dsn=MariaDB;uid=root” and the Provider name is “System.Data.Odbc”. These still work in another UiPath project in which I use Connect to database.

But, in the project in which I get the error, even if I add a new Connect to Database activity and configure it from scratch, I still get the message Connect to database: Could not load file or assembly ‘Microsoft.Data.SqlClient, Version=4.1.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5’ or one of its dependencies. The system cannot find the file specified.

Thanks in advance for any assistance.

Hi Bvasu, I was facing the same problem. downgrading to 1.6.1 fixed the problem.

image

I just tried that but then I got this error:
image

The error states syntax error, do you have a way to test your query outside ui path to see if it runs without problems? In case it does. You could try either A) use a different connector (Provider Name argument) or B) downgrade even further until you match the version that was working for you. I know that is not ideal but maybe a work around until Ui Path fix the problem

Hi @bvasu

Could you please try with Microsoft.Data.SqlClient for the Provider name property in a Windows project and let us know if it works then?

When I enterMicrosoft.Data.SqlClientin the Provider name property I get an exclamation point in a red circle. When I mouse over that red circle the follow pops up in a grey error box.

Compiler error(s) encountered processing expression

“Microsoft.Data.SqlClient”.(2) : error BC30456: ‘Data’ is not a member of

‘Microsoft’.

@bvasu

My appologies, when using the code blocks I should have typed it as:
"Microsoft.Data.SqlClient"

As a string value.

While I’m connecting have got this error could any one help me with this?