Page 1 of 1

Keyword not supported: 'initial catalog'

Posted: Tue 28 Feb 2017 10:42
by MikeBeaton
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: viewtopic.php?f=4&t=29641&sid=5d61f880a ... 2f09168468 .

(I am currently using Visual Studio 2015 and a .NET 4.5 project.)

Re: Keyword not supported: 'initial catalog'

Posted: Tue 28 Feb 2017 15:46
by Pinturiccio
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 ... tring.html

Re: Keyword not supported: 'initial catalog'

Posted: Tue 28 Feb 2017 16:31
by MikeBeaton
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.)

Re: Keyword not supported: 'initial catalog'

Posted: Fri 03 Mar 2017 16:26
by Pinturiccio
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.

Re: Keyword not supported: 'initial catalog'

Posted: Fri 03 Mar 2017 17:12
by MikeBeaton
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.

Re: Keyword not supported: 'initial catalog'

Posted: Mon 06 Mar 2017 15:11
by Pinturiccio
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.

Re: Keyword not supported: 'initial catalog'

Posted: Fri 17 Mar 2017 10:37
by Pinturiccio
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 viewtopic.php?t=35128