Précédent   Forum du club des développeurs et IT Pro > Dotnet > EDI/Outils > MonoDevelop
MonoDevelop Forum d'entraide sur l'utilisation de MonoDevelop, l'IDE open-source pour le développement Mono et .NET.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 22/01/2012, 17h37   #1
pascalwick
Candidat au titre de Membre du Club
 
Inscription : février 2004
Messages : 61
Détails du profil
Informations forums :
Inscription : février 2004
Messages : 61
Points : 13
Points : 13
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 :
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 :
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
__________________
Cosotech Informatique
Pascal Wick
Programmeur-Analyste Sr.
pascalwick est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 22/01/2012, 20h20   #2
pascalwick
Candidat au titre de Membre du Club
 
Inscription : février 2004
Messages : 61
Détails du profil
Informations forums :
Inscription : février 2004
Messages : 61
Points : 13
Points : 13
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.
__________________
Cosotech Informatique
Pascal Wick
Programmeur-Analyste Sr.
pascalwick est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 08h17.


 
 
 
 
Partenaires

Hébergement Web