Curt
Curt

Reputation: 46

MySQL Visual Studio 2015 You have a usable connection already

I'm fairly experienced with Visual Studio 2013 and I'm now upgrading to VS 2015 and running into and issue adding a new datasource to a Windows Forms Application. It is very easy to recreate my issue.

Here's my setup:

Visual Studio 2015 Enterprise 2015 Update 3
MySQL for Visual Studio 1.2.6
Connector/Net 6.9.9

Note: The above configuration is supported according to the support information matrix located at http://dev.mysql.com/doc/visual-studio/en/visual-studio-install.html and I've also tried just about every other permutation of supported software listed there.

Here's how to recreate the issue:

New C# Windows Forms Application
Add New Data Source
Database
Dataset
New Connection (connects just fine)
Save the connection
Choose your database objects
Select any table
Finish

Error: Some updating commands could not be generated automatically. The database returned the following error: You have a usable connection already.

Grateful for anyone who can even give a clue as to what I might be doing wrong.

Upvotes: 0

Views: 14390

Answers (5)

Paul Santiago
Paul Santiago

Reputation: 15

Follow these steps:

  1. Uninstall MySQL Connector/NET
  2. Reinstall MySQL Connector/NET

Upvotes: 0

Nayas Subramanian
Nayas Subramanian

Reputation: 2379

I tried out almost all the above mentioned solutions all of them failed at last what i did is

  1. Created DataSet manually by right clicking the project and added a new dataset.
  2. Then created DataTable in that with all the columns as same in the query.
  3. You can see Report Data Menu in rdlc report. Under that you can see DataSet you can drag and put datatable column to rdlc report.
  4. In backend you can write something like this

            var ds = this.GetData();
            var dt = ds.Tables[0];
            ReportViewer1.Reset();
            ReportViewer1.LocalReport.ReportPath = Server.MapPath("Report1.rdlc");
            ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", dt)); // same name as dataset created under report data menu
    
            ReportViewer1.DataBind();
    
            ReportViewer1.LocalReport.Refresh();
    

Upvotes: 0

Tharindu Shehan
Tharindu Shehan

Reputation: 96

  1. Install mysql-for-visualstudio-2.0.4.msi (here).
  2. Install Connector/Net 6.9.9.msi (here).

Upvotes: 6

Curt
Curt

Reputation: 46

Here's the solution I found. As I delved further I found that something (I know not what) was expecting Connector/net 6.9.9 and something else (again I don't know what) was expecting Connector/net 6.9.8. There is nothing in my projects or installation which should have referenced 6.9.8. In any event, I installed 6.9.8 and everything has worked perfectly since.

Upvotes: 1

Chris
Chris

Reputation: 1

I struggled with this for the last 24 hours.

First: have you deleted any project files from VS? I went to my recycle bin and restored everything from VS I had deleted.

This resolved the issue. Make sure any data connections from VS are restored.

If that doesn't work, let me know.

Upvotes: 0

Related Questions