title: Connecting Windows CE to mysql database
body: <p>We have a desktop POS built with vb.net and running on a local mysql db. We now want to add a PDA running windows CE 6.0 to execute some simple functions such as inventory management for which we need to connect from the PDA to mysql. We are developing the PDA app using vs 2008 in vb.net. The problem is trying to connect the PDA app to the mysql db. I have reviewed several threads (most of them unresolved) on several forums with no luck. I'm using the following connection method:</p>
  
  <pre><code>Imports MySql.Data.MySqlClient
  Public Class Form1
  Dim cn As MySqlConnection = New MySqlConnection("data source='localhost';database='dbname';user id='root';password='mypassword")
  End Class
  </code></pre>
  
  <p>When I reference <strong>mysql.Data</strong> I get the error <strong>Reference required to assembly System.Data, Version=2.0.0.0, culture=neutral, PublicKeyToken=b7 bla bla containing the base class System.Data.Common.Dbconnection. Add one to your project.</strong> I tried adding System.Data.Common but error still wont clear.</p>
  
  <p>I read somewhere that I should reference <strong>mysql.Data.CF</strong> rather, which I did and the error cleared. But then when I try to connect, I get an error at cn.Open() which says <strong>Unable to connect to any of the mysql hosts</strong></p>
  
  <p>So many other forums said so many other things that I tried without success.</p>
  
  <p>If someone has successfully done this before, could you please point me in the right direction. Or maybe I have the whole idea wrong?</p>
  
  <p>Thanks in advance</p>