Hi,
I have developed some kind of "punch card" application for my office. Currently I am using textfiles to keep the data but I'd like to migrate it to our MySQL server.
I installed the .NET MySQL Connector and tried using it in my program. Here's the only code i'm adding and actually trying to make work:
Dim conn as new MySQLConnection("server=intranet;uid=myuserid;pwd=mypassword")
conn.Open
This code has been added after the "InitializeComponent" call of the startup window's constructor event, before anything actually tried to do something (i.e. i'm not even launching custom code at this place). Unfortunately, it generates an exception trying to "conn.Open" stating that it cannot find the server.
After much toying around with servers and firewalls and a lot of googling, I can't find a solution to my problem. Then I decide to try it in a new, blank application... So i create a new WPF application, copy/paste the code after the initial window's InitializeComponent... and it works!!!!!
And then I try again within my application and it doesn't.
Anyone has a tip? I tried adding all of my .xaml and .xaml.vb files manually to the blank project (the one where the conn.Open worked) and all of a sudden, it doesn't work anymore and I get the "cannot connect" message again. It seems as if something, somewhere, is preventing the MySQL Connector from working even though I'm not even going into my other .xaml and .xaml.vb files before trying the conn.Open call.
I'm totally clueless, and I'm about to rewrite the whole program from scratch just because of this. Any idea such as how to debug such a problem would be appreciated...
Thanks!
I have developed some kind of "punch card" application for my office. Currently I am using textfiles to keep the data but I'd like to migrate it to our MySQL server.
I installed the .NET MySQL Connector and tried using it in my program. Here's the only code i'm adding and actually trying to make work:
Dim conn as new MySQLConnection("server=intranet;uid=myuserid;pwd=mypassword")
conn.Open
This code has been added after the "InitializeComponent" call of the startup window's constructor event, before anything actually tried to do something (i.e. i'm not even launching custom code at this place). Unfortunately, it generates an exception trying to "conn.Open" stating that it cannot find the server.
After much toying around with servers and firewalls and a lot of googling, I can't find a solution to my problem. Then I decide to try it in a new, blank application... So i create a new WPF application, copy/paste the code after the initial window's InitializeComponent... and it works!!!!!
And then I try again within my application and it doesn't.
Anyone has a tip? I tried adding all of my .xaml and .xaml.vb files manually to the blank project (the one where the conn.Open worked) and all of a sudden, it doesn't work anymore and I get the "cannot connect" message again. It seems as if something, somewhere, is preventing the MySQL Connector from working even though I'm not even going into my other .xaml and .xaml.vb files before trying the conn.Open call.
I'm totally clueless, and I'm about to rewrite the whole program from scratch just because of this. Any idea such as how to debug such a problem would be appreciated...
Thanks!
Last edited: