Keyword not supported: 'initial catalog'

Keyword not supported: 'initial catalog'

Postby MikeBeaton » Tue 28 Feb 2017 10:42

I have just downloaded and installed the most recent version of dotConnect for MySQL 8.7 Express.

Everything works fine when I use a connection string with providerName="Devart.Data.MySql" except that the "initial catalog" keyword is not supported (throwing a System.NotSupportedException).

This seems reminiscent of this bug: http://forums.devart.com/viewtopic.php?f=4&t=29641&sid=5d61f880a6d1b5a1b005592f09168468 .

(I am currently using Visual Studio 2015 and a .NET 4.5 project.)
MikeBeaton
 
Posts: 4
Joined: Tue 28 Feb 2017 10:26

Re: Keyword not supported: 'initial catalog'

Postby Pinturiccio » Tue 28 Feb 2017 15:46

dotConnect for MySQL does not have such a connection string parameter as "initial catalog". The "initial catalog" connection string parameter is used in SQL Server provider. Probably you have copied an SQL Server connection string and rewritten it for MySQL. Try replacing the "initial catalog" connection string parameter with "database". For more information, please refer to https://www.devart.com/dotconnect/mysql/docs/?Devart.Data.MySql~Devart.Data.MySql.MySqlConnection~ConnectionString.html
Pinturiccio
Devart Team
 
Posts: 1887
Joined: Wed 02 Nov 2011 09:44

Re: Keyword not supported: 'initial catalog'

Postby MikeBeaton » Tue 28 Feb 2017 16:31

Ah, thank you for the quick feedback, and "database=" does work fine for me, which is most of what I needed.

However...

My problem was more interesting than that, because I had first of all ported a SQL Server project to the Oracle/MySQL ADO.NET driver, and this DOES support "initial catalog=" as an alias for "database=", so I didn't notice anything and just carried on using it.

Then I wanted to see if my ported project would work with the Devart driver, which as you rightly say doesn't support "initial catalog=". But since my project was working on Oracle/MySQL and then stopped working fully when I switched to Devart, you can hopefully see why this looked to me (and might look to someone else...?) like it was a problem with the Devart driver.

Might it possibly even be an idea for you to support "initial catalog=" as an alias for "database=", because the Oracle/MySQL driver does?

(I have just tested, and they both support "database=" of course.)
MikeBeaton
 
Posts: 4
Joined: Tue 28 Feb 2017 10:26

Re: Keyword not supported: 'initial catalog'

Postby Pinturiccio » Fri 03 Mar 2017 16:26

MikeBeaton wrote:Might it possibly even be an idea for you to support "initial catalog=" as an alias for "database=", because the Oracle/MySQL driver does?

We will investigate the possibility to implement "Initial Catalog" connection string parameter as an alias to "database" connection string parameter in MySqlConnection.

As for dotConnect for Oracle, there is neither "Initial Catalog" nor "database" parameter in a connection string.
Pinturiccio
Devart Team
 
Posts: 1887
Joined: Wed 02 Nov 2011 09:44

Re: Keyword not supported: 'initial catalog'

Postby MikeBeaton » Fri 03 Mar 2017 17:12

True.
And Npgsql for PostgreSQL supports "database=" but not "initial catalog=".
But SQL Server actually supports "database=" as well as "initial catalog=".
And then for MySQL, Oracle/MySQL supports both, and yourselves only support "database="
Supporting both seems the 'friendliest'!
I agree it's not urgent and your documentation and current operation is completely correct.
MikeBeaton
 
Posts: 4
Joined: Tue 28 Feb 2017 10:26

Re: Keyword not supported: 'initial catalog'

Postby Pinturiccio » Mon 06 Mar 2017 15:11

We have added the "Initial Catalog" connection string parameter to MySqlConnection as an alias to the "Database" connection string parameter. We will post here when the corresponding build of dotConnect for MySQL is available for download.
Pinturiccio
Devart Team
 
Posts: 1887
Joined: Wed 02 Nov 2011 09:44

Re: Keyword not supported: 'initial catalog'

Postby Pinturiccio » Fri 17 Mar 2017 10:37

New version of dotConnect for MySQL 8.8 is released.
It can be downloaded from http://www.devart.com/dotconnect/mysql/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?t=35128
Pinturiccio
Devart Team
 
Posts: 1887
Joined: Wed 02 Nov 2011 09:44


Return to dotConnect for MySQL