locked
How to Access Remote MySql Database using C# in windows mobile RRS feed

  • Question

  • Hi all,

       I am writing windows mobile 6 application using c# but Can anyone explain how to access remote Mysql Database? how to connect to remote mysql server?

    Thanks & Regards
    Asif
    Wednesday, September 9, 2009 4:07 AM

Answers

  • Hi Asif,

    You need to download the installer for MySQL Connector/Net from:
     http://dev.mysql.com/downloads/connector/net/

    Upon installation you will be able to find a dll that is compiled for .NET Compact Framework. If you need more help on using that MySQL Connector, I would suggest you go to MySQL forum for better help:
    http://forums.mysql.com/list.php?38

    Regards,
    Chunsheng Tang
    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    • Marked as answer by warrentang Monday, September 14, 2009 6:44 AM
    Friday, September 11, 2009 7:33 AM

All replies

  • Hi Asif,

    I dont think ODBC is supported with CF. Better create a webservice to connect to MySQL and access webservice from your Mobile application.

    Regards,
    Malleswar
    Wednesday, September 9, 2009 7:51 AM
  • Hi Asif,

    You need to download the installer for MySQL Connector/Net from:
     http://dev.mysql.com/downloads/connector/net/

    Upon installation you will be able to find a dll that is compiled for .NET Compact Framework. If you need more help on using that MySQL Connector, I would suggest you go to MySQL forum for better help:
    http://forums.mysql.com/list.php?38

    Regards,
    Chunsheng Tang
    Please mark the post that helps you, and unmark that does not. This benefits our community members.
    • Marked as answer by warrentang Monday, September 14, 2009 6:44 AM
    Friday, September 11, 2009 7:33 AM
  • Connector/Net + C# + Windows Forms project = OK

    Connector/Net + C# + Smart Device project = Fail

     

    This is the error:

    The type 'System.Data.Common.DbConnection' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.    ..etc...etc

     

    .. I still waiting for the answer.

    Sunday, January 16, 2011 2:35 AM
  • Hi Asif,

    1. As suggested earlier by 'Warrentang', please verify that you have installed 'mysql connector' for .net.

    2. Verify that the installation have copied a file 'MySql.Data.CF.dll' at Program Files\MySql\...\.. folder

    3. Add a reference to this component in your solution.

    4. Use MySqlConnection() method of this component to make a db connection.

    5. If you have already followed this sequence and still you get error mentioned in your reply, you may need to add reference to 'System.Data'.

    6. How to add reference (This is just to complete the discussion)

    Solution Explorer-> Your Project -> Reference->Right click and select 'Add reference'-> choose 'System.Data' assembly from '.Net' tab. Verify that this assembly version is 2.0.0.0

    Regards,

    Mansukh

     

    Tuesday, January 18, 2011 7:09 AM
  • Just to add to my prevous reply...

    You may refer to this thread, which also could be helpful...

    http://social.msdn.microsoft.com/Forums/en-US/winembplatdev/thread/65d3b491-a0da-4ee5-b9f5-d416b078d866

    Tuesday, January 18, 2011 8:49 AM