Page 1 of 1

C# and MySQL connectors

Posted: Mon Jun 16, 2008 6:06 pm
by John Adams
Anyone know of an easy-to-implement solution for getting a C# app to connect to a MySQL server WITHOUT having to download and install MyODBC351? I am hoping to get an app to run and connect to a remote MySQL server without putting people through too much pain and misery.
My goal is to have an in-app config dialog to set the MySQL params up, stored in XML or something. Sound familiar?
Thanks,
J

Posted: Mon Jun 16, 2008 6:29 pm
by link2009
I'll get on it tomorrow.

Posted: Fri Jun 20, 2008 1:21 pm
by John Adams
This *might* be my solution. I didn't see anyone frothing at the mouth to advise me, so I hope this is the correct path to take. ;)

Code: Select all

http://www.codeproject.com/KB/database/ConnectingToMySQL.aspx

Posted: Sat Jun 21, 2008 9:50 am
by John Adams
Much to my dismay, if I try and use the .Net Connector instead of ODBC, I seem to not be able to use the fancy C# tableAdapter goodies in VS2005. I'll play around with it some more, but maybe the only solution is to install the ODBC 3.51 connector. :/

Posted: Sat Jun 21, 2008 10:25 am
by link2009
I hate the ODBC connection because EVERY client will have to install it.
I suggest the OleDB connector: http://www.aspfree.com/c/a/Database/Dat ... ing-OleDB/
But if you want the .NET one:
http://bitdaddys.com/MySQL-ConnectorNet.html

Posted: Sat Jun 21, 2008 11:23 am
by John Adams
Well here's what I am discovering so far. Being a super novice to Windows Application programming (GUI), I can place fields on a form and connect them to a data source using VS2005 with surprising ease - using ODBC 3.51 connector.
This morning, playing with anything that does not seem to be this ODBC connector, it appears I will have to manually code every f'n SQL command by hand for every field I wish to display or update... and to be honest, I do not have that kind of time to spare.
And, regarding these other solutions - will every user still have to install the Connector regardless in order to provide the drivers? Or is that all compiled into the code (this is what I want optimally)? I was hoping to, for example, give you an EXE and you run it -boom-. Everything works after you set 4 XML elements to your MySQL server info. But, I am struggling both conceptually and technically.
I am great with MySQL GUI Tools and DB work. But get me into a IDE, I am like a lost child. :)

Posted: Sat Jun 21, 2008 12:20 pm
by John Adams
link, man... I am just not getting it to work. I tried the demo app the guy at aspfree wrote, and it wont even compile. Obviously I am still missing a crucial step.
Is there any way you can whip up a small shell of a program that accesses MySQL data and zip it up for me? I'd like to see how you're doing it.
Meanwhile, I will stay on the (gulp) ODBC road for now. I already have so much done, it would be a pain in the ass to re-program all these fields to have to use a different data type anyway. sigh... confused.

Posted: Sat Jun 21, 2008 2:55 pm
by link2009
Okay, I'll need to take a look into this. I'll tell you what results I get.

Posted: Sat Jun 21, 2008 7:33 pm
by chrrox
John I can help you if you don't mind using visual basic here is the source for my app i started working on.
http://www.sendspace.com/file/l44w3e
the only thing it requires is the MySql.Data.dll file included with mysql library files.
If you have any questions on how it works let me know.
so far only the zone tab works on this editor.

Posted: Sun Jun 22, 2008 8:22 am
by John Adams
chrrox, that is freaking beautiful :D
Clean, simple, does exactly what I want it to do for behavior from building the connection to live updating fields when you enter zone # or name, or select from the search list.
See, this is why I am a DB guy, not a programmer. It will take me a year to figure out how to do this stuff. :)
Maybe we need to find all the people out there building database editing tools for EQ2Emu and consolidate into a team and get _one_ done. I like this one... nice and simple.
Good job!

Posted: Sun Jun 22, 2008 10:19 am
by Zcoretri
Yeah I'm one of those making a tool for myself. Decided to give VB.NET a try, been using VB6 forever, lol.

Posted: Tue Jun 24, 2008 6:35 pm
by John Adams
Woot, I finally sorted out the MySQL.Data.dll shit... I was using the wrong connector (of course). The 5.2.2 seems to work great! Allows all the fancy C# tableAdapter stuff and makes my life easier.
But yah, apparently you have to package the exe with the dll... which I am not sure is legal or whatever. Probably is, like I care anyway. ;)

Posted: Tue Jun 24, 2008 11:08 pm
by Zcoretri
Woot, I finally sorted out the MySQL.Data.dll shit... I was using the wrong connector (of course). The 5.2.2 seems to work great! Allows all the fancy C# tableAdapter stuff and makes my life easier.
Yeah...pretty amazing what it does with data with minimal amount of code.