Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connect To MySql
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01306023
Message ID:
01306077
Vues:
5
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform