How do I connect a Heidisql database to Visual Studio using Report Viewer packages?

Asked

Viewed 144 times

0

Follow the code of my comic book from Heidisql:

CREATE DATABASE ProdPacote;  
USE ProdPacote;

CREATE TABLE Produto(  
ID_Produto INT PRIMARY KEY AUTO_INCREMENT,  
Nome VARCHAR (200) NOT NULL,  
Descricao VARCHAR (200) NOT NULL,  
Preco DOUBLE NOT NULL);  

CREATE TABLE Pacote(  
ID_Pacote INT PRIMARY KEY AUTO_INCREMENT,  
Nome VARCHAR (200) NOT NULL,  
ID_Produto VARCHAR (200) NOT NULL,  
Quantidade INT NOT NULL,  
Data_entrada DATE NOT NULL,  
Data_saida DATE NOT NULL);  


CREATE TABLE Produto_Pacote(  
ID_Produto_Pacote INT PRIMARY KEY AUTO_INCREMENT,  
Data_Hora DATE NOT NULL,  
FK_ID_Produto INT NOT NULL,  
FK_ID_Pacote INT NOT NULL,  

CONSTRAINT Produto_Pacote  
FOREIGN KEY (FK_ID_Produto)  
REFERENCES Produto (ID_Produto),  

CONSTRAINT Pacote_Produto  
FOREIGN KEY(FK_ID_Pacote)  
REFERENCES Pacote(ID_Pacote)); 

That particular mistake won’t let me continue:

ERROR MESSAGE: Authentication to host 'localhost' for user 'root' method using 'mysql_native_password' failed with message: Access denied for user "root" @"localhost" (using password: YES)

inserir a descrição da imagem aqui

Mensagem de Erro: Failed to open a connection to the database "Cannot obtain provider factory for data provider named 'MySql.Data.MySqlClient'. " Check the conection and try again.

Some updating commands could generated automatically. The database returned the following error: You have a usuable connection already

  • The message is of login failure... you are sure that you are using the credentials and pointing to the correct host?

  • Thanks, I managed to fix the Login error, but now when I finish connecting to the database, the following appears Error: Failed to open a Connection to the database "Cannot obtain Provider Factory for data Provider named 'Mysql.Data.Mysqlclient'. " Check the conection and Try Again. Follow image above in the post.

1 answer

2


I had the same problem a few months ago, I followed this process and solved, detail I used specific versions and so I do not guarantee that it works in different versions. The process below solves the following errors:

  1. "Some updating Commands could not be generated Automatically. The database returned the following error: Unexpected Error"
  2. Error: Failed to open a Connection to the database "Cannot obtain Provider Factory for data Provider named 'Mysql.Data.Mysqlclient'. " Check the conection and Try Again.

PROPOSED SOLUTION:

  1. Uninstall "Connector /Net" and "Mysql for Visual Studio" if installed.
  2. Install "Mysql for Visual Studio v1.2.7" . NOTE: Install Mysql for Visual Studio before Connector / Net.
  3. Install "Connector / Net V6.9.8".
  4. Try to carry out the process you need.

Unfortunately working with Mysql in VS is quite complicated, many errors only solve with specific versions and often the problem even solves, but another appears.

  • Thanks, I managed to pass that step, but now when I select the tables in the Report, the following error appears: Some updating Commands could generated Automatically. The database returned the following error: You have a usuable Connection already. Follow image above.

  • Hello, so this is a clear issue of mysql for visual studio and Connector/Net. A while ago I heard reports of this problem here and it was the version. Apparently not all versions work in Visual Studio 2017. Try to redo the above process, only with the versions I put.

  • Managed to solve?

  • I did, thank you very much. Actually it was the versions of the connectors that I was using, I used the ones that you showed up there and it all worked out!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.