Page 1 of 1

CreateDatabase throws Method not found exception

Posted: Tue 17 Aug 2010 08:36
by ArieKanarie
Hi,

We are using the latest version (released on 28 july) of dotConnect for MySQL.
I've simple Winform app that must create a database from my datamodel. I try to do it with the following code:

Code: Select all

Dim Connection = New MySqlConnection(String.Format("server={0}; port={1}; User id={2}; Password={3}; Database={4}", _
                                                           edServer.Text, _
                                                           edPort.Text, _
                                                           edUser.Text, _
                                                           edPass.Text, _
                                                           Me.Database))

            Dim db As New MagentoDB.MagentoDB(Connection)
            If db.DatabaseExists Then
                If MsgBox("Database exists, delete database?", MsgBoxStyle.YesNo, "Database exists") = MsgBoxResult.Yes Then
                    db.DeleteDatabase()
                Else
                    Return False
                End If
            End If
            db.CreateDatabase()
But both DeleteDatabase and CreateDatabase fail with the following exception:

Code: Select all

Methode not found: Boolean Devart.Data.Linq.LinqCommandExecutionException.CanThrowLinqCommandExecutionException(System.String, System.Exception).
It doesn't matter if I use the overload versions of DeleteDatabase and CreateDatabase, I still get that exception.

Another (wierd) thing: in the connectionstring I provide a databasename (Me.Database) which doesn't exist on the server, but db.DatabaseExists return True.

Am I missing a DLL, an import or something else?

Posted: Wed 18 Aug 2010 12:06
by StanislavK
Thank you for your report, we've reproduced the problem with CreateDatabase.

As for the DatabaseExists method, in our environment it returns false though the database exists on the server.

We will investigate both issues and inform you about the results.

Posted: Thu 19 Aug 2010 06:35
by ArieKanarie
Thanks for your reply, I'll wait until you've the results. Until then I'll do it with plain SQL.

Posted: Thu 19 Aug 2010 15:28
by StanislavK
Please note that you can use the OracleScript class for executing multiple SQL commands. This can be helpful to create and populate large amounts of database objects.

Posted: Mon 04 Oct 2010 08:41
by ArieKanarie
StanislavK wrote:Please note that you can use the OracleScript class for executing multiple SQL commands. This can be helpful to create and populate large amounts of database objects.
A little kick.
We are using MySQL, so is OracleScript an option? Or is there also a MySqlScript?

I saw that there is a new version but I don't see anything mentioned about this bug :(

Posted: Mon 04 Oct 2010 11:14
by StanislavK
Sorry for 'Oracle', the MySqlScript component was meant:
http://www.devart.com/dotconnect/mysql/ ... cript.html

We couldn't reproduce the problem with the latest version. Please try dotConnect for MySQL 5.80.170 and tell us if the CreateDatabase/DatabaseExists methods work properly in your environment now. You can download the latest build from
http://www.devart.com/dotconnect/mysql/download.html
(the trial version) or from Registered Users' Area (provided that you have an active subscription):
http://secure.devart.com/