IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

MonoDevelop Discussion :

MySql exception sur ouverture de la bd Socket Monodevelop 2.4 Ubuntu 11.04


Sujet :

MonoDevelop

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Février 2004
    Messages
    62
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 62
    Points : 43
    Points
    43
    Par défaut MySql exception sur ouverture de la bd Socket Monodevelop 2.4 Ubuntu 11.04
    Bonjour

    J ai un probleme avec le connector mysql pour mono,

    J ai un projet existant dont j ai travailler dessus il y a 6 mois et je n arrive pas a ouvrir une connection mysql, Mon user est bien dans le group mySql,

    j ai essayer de mettre toute la solution a du 2.0 avant en 3.5; marche po

    truc de bizarre je me part une nouvelle appli console avec ce code et j ouvre la connection sans probleme.

    a oui la dll mysql,data,dll a ete renome en MySql,Data,dll et a ete ajouter dans le gac

    Ca me tente vraiment pas de recommencer la solution,

    le probleme peut venir d ou selon vous? car la je suis decourager et je ne trouve plus,

    le code causant le probleme
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    string connectionString =
              "Server=localhost;" +
              "Database=taskmanager;" +
              "User ID=root;" +
              "Password=passdelamortquitue;" +
              "Pooling=false";
           IDbConnection dbcon;
           dbcon = new MySqlConnection(connectionString);
           dbcon.Open();
    l exception
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    Unhandled Exception: MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Net.Dns ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Net.Sockets.Socket ---> System.Configuration.ConfigurationErrorsException: Error Initializing the configuration system. ---> System.Xml.XmlException: Document element did not appear.  Line 1, position 1.
      at Mono.Xml2.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
      at System.Xml.XmlTextReader.Read () [0x00000] in <filename unknown>:0 
      at System.Xml.XmlReader.MoveToContent () [0x00000] in <filename unknown>:0 
      at System.Configuration.Configuration.ReadConfigFile (System.Xml.XmlReader reader, System.String fileName) [0x00000] in <filename unknown>:0 
      at System.Configuration.Configuration.Load () [0x00000] in <filename unknown>:0 
      at System.Configuration.Configuration.Init (IConfigSystem system, System.String configPath, System.Configuration.Configuration parent) [0x00000] in <filename unknown>:0 
      at System.Configuration.Configuration..ctor (System.Configuration.InternalConfigurationSystem system, System.String locationSubPath) [0x00000] in <filename unknown>:0 
      at System.Configuration.InternalConfigurationFactory.Create (System.Type typeConfigHost, System.Object[] hostInitConfigurationParams) [0x00000] in <filename unknown>:0 
      at System.Configuration.ConfigurationManager.OpenExeConfigurationInternal (ConfigurationUserLevel userLevel, System.Reflection.Assembly calling_assembly, System.String exePath) [0x00000] in <filename unknown>:0 
      at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in <filename unknown>:0 
      --- End of inner exception stack trace ---
      at System.Configuration.ClientConfigurationSystem.get_Configuration () [0x00000] in <filename unknown>:0 
      at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 
      at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 
      at System.Net.Sockets.Socket.CheckProtocolSupport () [0x00000] in <filename unknown>:0 
      at System.Net.Sockets.Socket..cctor () [0x00000] in <filename unknown>:0 
      --- End of inner exception stack trace ---
      at System.Net.Dns..cctor () [0x00000] in <filename unknown>:0 
      --- End of inner exception stack trace ---
      at MySql.Data.Common.StreamCreator.GetDnsHostEntry (System.String hostname) [0x00000] in <filename unknown>:0 
      at MySql.Data.Common.StreamCreator.GetHostEntry (System.String hostname) [0x00000] in <filename unknown>:0 
      at MySql.Data.Common.StreamCreator.GetStream (UInt32 timeout) [0x00000] in <filename unknown>:0 
      --- End of inner exception stack trace ---
      at MySql.Data.MySqlClient.NativeDriver.Open () [0x00000] in <filename unknown>:0 
      at MySql.Data.MySqlClient.Driver.Open () [0x00000] in <filename unknown>:0 
      at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in <filename unknown>:0 
      at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00000] in <filename unknown>:0

    Merci pour votre aide
    Groupe OnePoint
    Pascal Wick
    Programmeur-Analyste Sr.

  2. #2
    Membre du Club
    Profil pro
    Inscrit en
    Février 2004
    Messages
    62
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2004
    Messages : 62
    Points : 43
    Points
    43
    Par défaut
    Bon je viens d'essayer de recreer la solution en important les projet deja existant et ca ne fonctionne toujours pas.

    Prochaine etape, recreer mon projet d acces aux donnee dans ce nouveau fichier de solution. Car je viens encore de le tester lorsque je creer une nouvelle solution vide, j ajoute une class librairie et je creer ma connection sans probleme.

    Ca doit etre dans ma dal qu il y a une merde mais j'aimerais bien savoir ou car je ne suis pas pour faire cela a chaque fois.
    Groupe OnePoint
    Pascal Wick
    Programmeur-Analyste Sr.

Discussions similaires

  1. exception sur le webservice quand server MYSQL ne répond pas
    Par midialzer dans le forum Silverlight
    Réponses: 1
    Dernier message: 07/06/2013, 11h54
  2. [EF][C#] Pas d'exception sur ouverture de base
    Par ClaudeBg dans le forum Accès aux données
    Réponses: 5
    Dernier message: 20/01/2009, 17h55
  3. [EF][C#] Pas d'exception sur ouverture de base
    Par ClaudeBg dans le forum Linq
    Réponses: 5
    Dernier message: 20/01/2009, 17h55
  4. levée d'exception sur ouverture fichier excel
    Par LeXo dans le forum VB 6 et antérieur
    Réponses: 3
    Dernier message: 11/10/2006, 14h30
  5. EXCEPTION sur l'ouverture d'un curseur
    Par atruong dans le forum Oracle
    Réponses: 6
    Dernier message: 03/05/2006, 12h21

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo