Error on Devart.Data.MySql.EnterpriseLibrary.MySqlDatabase

Error on Devart.Data.MySql.EnterpriseLibrary.MySqlDatabase

Postby rvzip64 » Wed 14 Sep 2011 09:21

I use Enterprise Library 5.0 with dotconnect for Mysql

on this line :
Code: Select all
private Database dtBase = DatabaseFactory.CreateDatabase("MySQLServer");



I obtain this error

The type 'Devart.Data.MySql.EnterpriseLibrary.MySqlDatabase, Devart.Data.MySql.EnterpriseLibrary, Version=6.50.214.0, Culture=neutral, PublicKeyToken=null' cannot be resolved. Please verify the spelling is correct or that the full type name is provided.



Here my app.config
Code: Select all


   
       

   
   
       
                            name="Devart.Data.MySql" />
       

   

   
                    providerName="Devart.Data.MySql" />
   





I don't undertand where is the problem ...
Please could you help me ?[/code]
rvzip64
 
Posts: 17
Joined: Wed 19 Sep 2007 08:51

Postby rvzip64 » Wed 14 Sep 2011 09:33

I found my problem ....
I need to add Devart.Data.MySql.EnterpriseLibrary in assembly reference :lol:
rvzip64
 
Posts: 17
Joined: Wed 19 Sep 2007 08:51

Postby rvzip64 » Wed 14 Sep 2011 09:57

An other problem ...
All is fully fonctionnal on my computer, but when i publish my software by ClickOnce, I have a crash on this line:
Code: Select all
private Database dtBase = DatabaseFactory.CreateDatabase("MySQLServer");


And a Microsoft report is generated
rvzip64
 
Posts: 17
Joined: Wed 19 Sep 2007 08:51

Postby rvzip64 » Wed 14 Sep 2011 14:41

I'm on dotConnect trial ...
May be that is the problem ...
rvzip64
 
Posts: 17
Joined: Wed 19 Sep 2007 08:51

Postby Shalex » Fri 16 Sep 2011 16:49

rvzip64 wrote:I'm on dotConnect trial ...
May be that is the problem ...

The trial version of dotConnect for MySQL is a fully functional version that can be used for the period of 30 days.
rvzip64 wrote:All is fully fonctionnal on my computer, but when i publish my software by ClickOnce, I have a crash on this line:
Code: Select all
private Database dtBase = DatabaseFactory.CreateDatabase("MySQLServer");

Could you please get an inner exception (with call stack) which is thrown by the Devart components? Tell us the exact text of the exception.

The deployment and technical licensing topics are here:
http://www.devart.com/dotconnect/mysql/ ... yment.html
http://www.devart.com/dotconnect/mysql/ ... nsing.html
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44

Postby rvzip64 » Thu 22 Sep 2011 08:33

Thank you for your reponse Shalex.

Here my Stack after crash.
I hope it can help you


.ctor
.ctor
BuildUp_HCIM.Modules.Production.Preview.ViewModel.EquipmentsViewModel
BuildUp
PreBuildUp
ExecuteBuildUp
NewBuildUp
Resolve
BuildUp_HCIM.Modules.Production.Preview.EquipmentsView
BuildUp
PreBuildUp
ExecuteBuildUp
DoBuildUp
Resolve
Resolve
Initialize
InitializeModules
Run
Run
OnStartup
<.ctor>b__1
InternalRealCall
TryCatchWhen
InvokeImpl
InvokeInSecurityContext
runTryCode
ExecuteCodeWithGuaranteedCleanup
RunInternal
Run
Run
Invoke
ProcessQueue
WndProcHook
WndProc
DispatcherCallbackOperation
InternalRealCall
TryCatchWhen
InvokeImpl
SubclassWndProc
DispatchMessage
PushFrameImpl
PushFrame
RunDispatcher
RunInternal
Run
Run
Main


Best regards
rvzip64
 
Posts: 17
Joined: Wed 19 Sep 2007 08:51

Postby rvzip64 » Thu 22 Sep 2011 09:01

And the exception

Activation error occured while trying to get instance of type Database, key "MySQLServer"


Best regards
rvzip64
 
Posts: 17
Joined: Wed 19 Sep 2007 08:51

Postby rvzip64 » Thu 22 Sep 2011 09:38

So the error is generated by Enterprise Library.
I don't no why, but the application can't read app.config

I will correct my software like this :

Code: Select all
dtBase = new MySqlDatabase("host=TLSE-DB;database=DB;User id=root;password=root");


Please could you validate ?
(I bought the Component DotConnect for Mysql)

Best regards.
rvzip64
 
Posts: 17
Joined: Wed 19 Sep 2007 08:51

Postby Shalex » Tue 27 Sep 2011 15:18

I have made the following settings to create a working project (console application, .NET 3.5) with dotConnect for MySQL v 6.50.214:
- App.config:
Code: Select all


 
   

 
 
          name="DataAccessQuickStart"
      providerName="Devart.Data.MySql"
      connectionString="host=db;port=3308;database=test;User id=root;password=root;" />
 

 
   
            databaseType="Devart.Data.MySql.EnterpriseLibrary.MySqlDatabase, Devart.Data.MySql.EnterpriseLibrary"
      name="Devart.Data.MySql" />
   

 


- Added references to:
\Program Files\Devart\dotConnect\MySQL\Devart.Data.dll
\Program Files\Devart\dotConnect\MySQL\Devart.Data.MySql.dll
\Program Files\Devart\dotConnect\MySQL\Enterprise Library\NET3.5\bin\Devart.Data.MySql.EnterpriseLibrary.dll
\Program Files\Devart\dotConnect\MySQL\Enterprise Library\NET3.5\bin\Microsoft.Practices.EnterpriseLibrary.Common.dll
\Program Files\Devart\dotConnect\MySQL\Enterprise Library\NET3.5\bin\Microsoft.Practices.EnterpriseLibrary.Data.dll

- Working code:
Code: Select all
    MySqlDatabase dtBase = new MySqlDatabase("host=db;port=3308;database=test;User id=root;password=root;");
    IDataReader reader = dtBase.ExecuteReader(CommandType.Text, "select * from dept");
    while (reader.Read())
        Console.WriteLine(reader[0]);
    Console.ReadKey();


If this doesn't help, please send us:
1) a small test project to reproduce the issue in our environment;
2) .NET call stack with the Devart.* components. Navigate to the Debug > Exceptions menu of VS and select the "Thrown" checkbox for "Common Language Runtime Exceptions".
Shalex
Devart Team
 
Posts: 7377
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for MySQL