Connection to MySQL DB with MySQL Direct .NET Mobile

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
inf
Posts: 5
Joined: Fri 17 Feb 2006 13:54
Contact:

Connection to MySQL DB with MySQL Direct .NET Mobile

Post by inf » Fri 17 Feb 2006 14:03

Hi User,

a question : i'm using Visual Studio .NET 2003 and MySQL Direct.NET Mobile. I have a mobile device, which runs with Windows CE 4.20.00(no Pocket PC!). Now I would like to combine on this device to a MySQL database on the Internet. Is that possible without problems? If so, is there somewhere code examples ?

Sorry for my bad english :wink:

Serious

Post by Serious » Fri 17 Feb 2006 14:16

MySQLDirect .NET Mobile is designed for .NET Compact Framework 1.0 platform. This .NET Framework version can be installed on Windows CE device as well as on a Pocket PC device.

There is a set of demo projects in MySQLDirect .NET Mobile installation directory. These projects are designed for Pocket PC, but you can refer to them when creating Windows CE application using VS2003 wizards.

inf
Posts: 5
Joined: Fri 17 Feb 2006 13:54
Contact:

Post by inf » Mon 20 Feb 2006 08:05

Hi Serious,

thanks a lot for your answer. I have taken the following code as an example:

Dim oMySqlConn As MySqlConnection = New MySqlConnection

oMySqlConn.ConnectionString = _
"User ID=uid;" & _
"Password=pw;" & _
"Host=ip;" & _
"Port=3306;" & _
"Database=db;" & _
"Direct=true;" & _
"Protocol=TCP;" & _
"Compress=false;" & _
"Pooling=true;" & _
"Min Pool Size=0;" & _
"Max Pool Size=100;" & _
"Connection Lifetime=0"

oMySqlConn.Open()


If I explain this, I get the error message "An unhandled exception of type 'CoreLab.MySql.MySqlException' occurred in CoreLab.MySql.dll

Additional information: Can't connect to MySQL server on '212.227.118.11' (10061)".

How can I remove this?

Serious

Post by Serious » Mon 20 Feb 2006 08:34

Check if you can connect to the database using standard mysql command-line client application.
Use following command: mysql -h -u -D -p -P 3306
Do not use other client applications when testing connectivity.

inf
Posts: 5
Joined: Fri 17 Feb 2006 13:54
Contact:

Post by inf » Mon 20 Feb 2006 12:37

OK, the connection works fine. The mistake lay with me.

But i have a new problem : When i make a new project basend on Windows CE as a Smart Device Application, i haven't the tab mysqldirect in the tab window. When i placed a MySql Command on the form and rename it, the error "invalid property value" comes.

I reinstalled MySQLDirect.Net Mobile and the .NET Framework 1.1. The corelab modules have all the same version number "3.20.9.0".

how can i fix the problem ??

Serious

Post by Serious » Mon 20 Feb 2006 13:41

Make sure MySQLDirect .NET Mobile Addin is loaded (use Tools | Add-In Manager menu command).
Check also if you referenced correct assembly when adding component. Application must have reference to CoreLab.MySql assembly, components are placed in the CoreLab.CF.MySql assembly.

inf
Posts: 5
Joined: Fri 17 Feb 2006 13:54
Contact:

Post by inf » Tue 21 Feb 2006 10:45

I checked the following :

> Mobile Addin is loaded
> Reference to CoreLab.MySql is ok

If I liked to place the element on the form, the same mistake still appears.

inf
Posts: 5
Joined: Fri 17 Feb 2006 13:54
Contact:

Post by inf » Tue 21 Feb 2006 14:47

I fixed the problem. After downloading and reinstall .NET Framework 1.1 from Microsoft, i installed the .NET 1.1 SP1 and now it works :D

Thanks for your help Serious !

Post Reply