Lounge Network - Knowledge Base

  View Printer Friendly Version Search
KNOWLEDGE BASE HOME » 14. INFORMATION: CORPORATE & BUSINESS HOSTING Viewing Answer
[WINDOWS] How can I connect to a MySQL database from the windows server?
Below is a sample code.

********************************************************************
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" +
"SERVER=db.mydns.net.nz;" +
"DATABASE=blah_db;" +
"UID=blah_user;" +
"PASSWORD=blah_passwd; Trusted_connection=yes;" +
"OPTION=3";

OdbcConnection conn = new OdbcConnection(MyConString);
string myInsertQuery = "SELECT value FROM Counters WHERE id=1";
********************************************************************


More connection strings can be found at http://www.connectionstrings.com/

KNOWLEDGE BASE HOME » 14. INFORMATION: CORPORATE & BUSINESS HOSTING Viewing Answer




Knowledgebase Manager

© Copyright Lounge Network 2001-2017