Visual Studio 2019 MySql Data Sources Failed to open connection Error - mysql

I know this is a well trodden path, but my review of SO posts around this yielded no results. So this is a fresh installation of MySQL and Visual Studio 2019 on my dev machine - like both literally vanilla tonight. I used the Development installation for MySQL:
So I can connect to a test database just fine with Server Explorer. I can also Add Connection fine (that is it sees the remote database), but when I come to click next on Choose your data connection, I get this error:
I come across this problem every time I try to set up MySql and VS together. On this occation, I'm working with the latest MySQL version and thus have gone for the latest MySql binaries. As I say, I've reviewed all of the historic SO posts, but cant apply them to this. Does anyone have any ideas? (I had to downgrade to VS2019 because there's no MySql for VS 2022).

Related

Failed to open a connection to the database; MySQL.Data.MySQLClient; Cannot create a design window for the selected object

I am using
Visual studio 2017, version 15.9.11
MySQL for visual studio 1.2.9
MySQL-8.0.18-win64
mySQL-connector-net-8.0.18-noinstall
If I try to add a connection to a project via Data Sources > Database > Dataset, and set the connection with the right server name, user name, and password, and then select one table, select options and click Next I get the following error
"Failed to open a connection to the database Cannot obtain
provider factory for data provider named 'MySql.Data.MySQLClient'.Check the connection and try again."
Also, when I connect to a local MySQL database using Tools > Connect to database... and I create the connection, which successfully seems to be done in the server explorer, and then in the same server explorer panel, if I go Data Connections > localhost > tables > double-click on the table, this is the error I get:
Cannot create a design window for the selected object.
How can I solve this?
The problem
As I said in my question I had mysql-connector-net-8.0.18-noinstall extracted. I tend to extract binaries instead of installing things. Don't really have a good reason for this behavior.
After checking Vignesh solution and before uninstalling anything, I decided to give a try to the mysql-installer-community-8.0.18.0.msi installer, since I had the mysql-connector-net-8.0.18-noinstall extracted in one folder and then I added a reference in the project, which was not working. Perhaps there was a way to use this folder (binaries, global references, etc) properly, but I couldn't find one. Maybe I was the problem.
The solution
However, after installing via the msi file, everything is working now. So if you ran into this problem, having similar versions than the ones I'm using and had the no-install version extracted, you can safely close Visual Studio, and install the same version via the msi installer, this worked for me! Worst case scenario, you can uninstall it via the same msi file, and try Vignesh's or other's solution.
This error will be fixed by uninstalling Connector current version and installing Connector 6.9.8
Download Connector 6.9.8
Visual Studio 2015: Visual Studio 2015 Community + DotNet Connector 6.9.8 + MySQL for Visual Studio 2.0.3 is working combination.
Visual Studio 2017: Visual Studio 2017 Community + DotNet Connector 6.9.8 + MySQL for Visual Studio 1.2.7 is working.

sql server connection not showing up

I have mysql installed (including the connector for .net) and visual studio 2019 installed but when I try to connect via the one of the connections I have on the work bench by entering the name (it doesnt show up on the dropdown) I get the following error: server was not found or not accessible
here is the relevant server information
here a few other stack overflow related questions I found but none of them were helping me:
Why am I getting "Cannot Connect to Server - A network-related or instance-specific error"?
SQL Server is not showing in Visual Studio
How do I ensure Remote connections are allowed?
Also I have visual studio 2019 which meant I couldn't download the special mysql toolbar but does that mean it won't work at all with visual studio 2019?
You have 2 pictures in your post, in the first you try to connect to SQL Server, not to MySQL.
Your second image says that MySQL connection was made.
So I imagine that you need to connect to MySQL, not to SQL Server, so you should not choose Data Provider for SQL Server, but any driver for MySQL
what ended up working is if I go back and install vs2017 as oppose to vs 2019.

Can't connect to MySQL data source in Visual Studio 2017

When I try to add a new data source, I can get as far as the final screen where you select your tables before getting this error when I press finish:
except I don't have a usable connection??? This is a completely fresh C# Windows Forms project with zero code written or anything else done to it.
I have uninstalled and reinstalled both MySQL and Visual Studio, no exaggeration, at least ten times. I have tried every single recommendation for permutations of MySQL for Visual Studio and Connector/Net, including all the ones in this post even though they were only meant to work for VS 2010. Not a single one has made any difference and some have even made the problem worse by removing MySQL as an option altogether from the data source list.
I'm absolutely desperate at this point for any help since it seems there has been literally one other person having this problem with VS 2017 and what worked for them isn't working for me.
I am running:
Visual Studio Community 2017, Version 15.9.6
MySQL 8.0.14
MySQL for Visual Studio 1.2.8
Connector/Net 8.0.14
Self-answer as I was able to fix the problem by uninstalling the above versions of MySQL for VS and the Connector, and installing instead MySQL for Visual Studio 1.2.7 and Connector/Net 6.9.8 from the linked archives. It still gives a "Specified cast is not valid" error when connecting the data source but it does not seem to impact functioning.

Version compatibility issue in SQL Server and SSIS Packages

Currently in my machine visual studio community version 2017 version 15.9.3 has been installed and in server Microsoft SQL Server 2016 (SP1-CU3) has installed.
The issue is once I build the solution with available version and deploy it to server it gives following errors
even if i rebuild the ssis packages using old VS version and deploy it in server, still shows same error,
seems SSIDB keep tracking some meta data related to latest version deployment ispac.
still trying to figure it out the cause for this.
Initially what I want to do is using older version of VS ,need to deploy the ispac SSIS packages.
Thanks.
I encountered similar issue while upgrading from 2008/2012 to 2017. Somehow VS is not able to upgrade .NET version, even if you do so manually, it keeps coming back to the previous one. Your problem might be related to yet another issue though, but the last message in that validation outcome you pasted actually says about invalid script version and a failure while upgrading it automatically. If you only have a few of those scripts that are causing the problem, I would copy and paste the script to a brand new script component. If you have more, what helped us was this answer.
This is a common issue. If you build SSIS packages in VS(SSDT) 2017 and they have script components/tasks, they will not work on SQL Server 2016. Even though you set 2016 as the Target Version.
The only solution I know is to build your SSIS packages in VS(SSDT) 2015.

Users aren't able to run an Access 2007 app, after upgrading to Windows 10

We've got some MS Access 2007 apps here. I'm responsible for one. Normally, it never gives any problems. I haven't heard from the users of this app for over a year, until today. It was written years ago by someone (I don't know who) that is long gone, with little documentation. We're in the process of replacing all of our Windows 7 machines with Windows 10 machines. At first I thought that was the issue. However, one of my colleagues, who is responsible for a number of Access 2007 apps, said that his users are able to use their Access apps with no problem.
Looking back at the user's error, it says simply, "ODBC - call failed". No error number; just that. So, my next thought was maybe there was a missing DSN on the new Windows 10 machine. However, I asked the PC tech to check one of the working Windows 7 machines. He told me there were no DSN's in them. I'm not an Access developer, so I asked my colleague, who does do Access development, what he could discover. He found that the tables are all linked tables from a SQL Server database. Looking at what he was referring to (now that I know where to look) I saw what he meant. The connection to each of those tables uses trusted connections. They're all pointing to the correct SQL database server. That server is there. When I got into SSMS I could easily see data in the tables.
So, what could be causing that error to occur, especially since it doesn't look like it needs a DSN to make a connection to the SQL db?
I presume your Windows 10 is 64-bit.
And probably your Access is 32-bit.
Its important to know!
If my assumptions are correct, you need to use the 32-bit version of ODBC admin to setup the DSN.
The 32-bit version is 'C:\Windows\SysWOW64\odbc32.exe'
The 64-bit version is 'C:\Windows\System32\odbc32.exe'
32-bit Access will look for a DSN setup using the 32-bit version of ODBC admin, even on a 64-bit OS. If you setup the DSN with the 64-bit version of ODBC admin, then a 32-bit Access will not see it!
Go back on the Windows 7 PC, and check exactly how the DSN is setup.
Is it a System, User, or File DSN?
Which drivers are installed for SQL Server?
(There are various different ODBC clients available for SQL Server.)
Replicate this DSN configuration when you create the DSN on Windows 10.
It sounds like you using the 'SQL Server Native Client' on Windows 7,
so make sure to install that on Windows 10.
See: Installing SQL Server Native Client