visual studio 2019 is unable to retrieve list of the database

noel brice makebel 0 Reputation points
2023-04-18T16:19:13.4633333+00:00

first of all, I Opened Visual Studio and create a new project and I Clicked on the "View" menu and select "Server Explorer". In the Server Explorer window, I right-click on "Data Connections" and select "Add Connection". In the "Add Connection" dialog box, I selected "MySQL Database" as the data source. In the "Data Source" field, I entered the name of the MySQL(localhost) In the "User Name" (root) and "Password" fields(was empty since I did not create a password for my database) then I Clicked the "Test Connection" button to test the connection to the MySQL server. Firstly, an error message popped up saying "object cannot be cast from DBNull to other" and after clicking 3 times a message popped up saying "connection is successful", and when I tried to retrieve the database a message popped up again saying "unable to retrieve list of the database". I am a student so I just followed all rules my instructor said but the connection fail. I am using PhPMyAdmin for MySQL.visual studio

Screenshot database error

Viva Connections
Viva Connections
A Microsoft Viva module that provides a gateway to a modern engagement experience.
87 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
719 questions
{count} votes

1 answer

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 27,722 Reputation points Microsoft Employee
    2023-04-21T19:44:29.1533333+00:00

    Hi, @noel brice makebel I tried to reproduce this but realized I could not since the MySQL plugin is not supported in VS 2022 version. Note that Visual Studio MySQL plugin is not being maintained anymore https://downloads.mysql.com/archives/visualstudio/

     I recommend using alternate tools like Azure data studio, or community MySQL tools due to end of life in 2022 for this plugin in VS 2019.  you can also use VS code, there is mysql extension available in VS Code to connect and manage the database within VS Code like querying, editing in line, etc. 

    Regards

    Geetha