2 responses to “How do i connect a windows C# application to a remote Mysql database?”

  1. wallmeister

    It’s the same for a remote database as local. When you set up the data source, just specify the remote server.

  2. Rott

    You need to install the drivers to setup an ODBC connection which can be found here:

    http://www.mysql.com/products/connector/

    After you have the drivers installed, setup your DSN to connect to your remote mysql database. You will likely need to add your ip to the Remote Database Access Hosts depending on how the Mysql server is configured.

    You will then be able to use code as follows (replace the DSN name “test” with the name you provide when creating the DSN):

    using System.Data.Odbc;
    OdbcConnection DbConnection = new OdbcConnection(“DSN=test”);
    DbConnection.Open();

    OdbcCommand DbCommand = DbCommand.CommandText = “SELECT * FROM TABLE”;
    OdbcDataReader DbReader = DbCommand.ExecuteReader();DbConnection.CreateCommand();

Incoming search terms:

Powered By Pligg business loans, pligg content management system physics projects, Powered By Pligg meaning, powered by vBulletin best business home opportunity, powered by vBulletin business loans, powered by SMF code, Powered By Pligg exercise, pligg content management system internet home based business, Powered By Pligg free sound card, pligg content management system small business financing