Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connect To MySql
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Miscellaneous
Thread ID:
01306023
Message ID:
01306077
Views:
4
>I have installed MySql and the sample Sakila database from http://dev.mysql.com/doc/sakila/en/sakila.html#sakila-installation
>
>I cannot seem to get connected. I have
>
>
>using System;
>using System.Collections.Generic;
>using System.Text;
>using System.Data;
>using System.Data.Odbc;
>using MySql.Data.MySqlClient;
>
>namespace ConsoleApplication1
>{
>    class Program
>    {
>        static void Main(string[] args)
>        {
>
>            string sConnString = "SERVER=MySql;DATABASE=sakila;UID=Root;PASSWORD=#####;";
>            MySqlConnection oConnection = new MySqlConnection(sConnString);
>
>            oConnection.Open();
>
>
>        }
>    }
>}
>
>
>I get the error ""Unable to connect to any of the specified MySQL hosts."
>
>
>I have zero experience with MySql. Can anyone point the way?

I'd suggest initially creating a connection using Server Explorer - then you can find the connection string to use by examining the properties of the connection.
HTH,
Viv
Previous
Reply
Map
View

Click here to load this message in the networking platform