CreateDatabase throws Method not found exception

CreateDatabase throws Method not found exception

Postby ArieKanarie » Tue 17 Aug 2010 08:36

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?
ArieKanarie
 
Posts: 3
Joined: Tue 17 Aug 2010 08:17

Postby StanislavK » Wed 18 Aug 2010 12:06

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.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby ArieKanarie » Thu 19 Aug 2010 06:35

Thanks for your reply, I'll wait until you've the results. Until then I'll do it with plain SQL.
ArieKanarie
 
Posts: 3
Joined: Tue 17 Aug 2010 08:17

Postby StanislavK » Thu 19 Aug 2010 15:28

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.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Postby ArieKanarie » Mon 04 Oct 2010 08:41

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 :(
ArieKanarie
 
Posts: 3
Joined: Tue 17 Aug 2010 08:17

Postby StanislavK » Mon 04 Oct 2010 11:14

Sorry for 'Oracle', the MySqlScript component was meant:
http://www.devart.com/dotconnect/mysql/docs/Devart.Data.MySql~Devart.Data.MySql.MySqlScript.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/
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to dotConnect for MySQL