C# and MySQL connectors

Topics related to tools created by the Core Team or 3rd-party community members.

Moderator: Team Members

Post Reply
User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

C# and MySQL connectors

Post by John Adams » Mon Jun 16, 2008 6:06 pm

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

link2009
Retired
Posts: 390
Joined: Fri Aug 10, 2007 5:59 pm
Location: POrTal
Contact:

Post by link2009 » Mon Jun 16, 2008 6:29 pm

I'll get on it tomorrow.
Image
-Vecinu de la Patru

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Fri Jun 20, 2008 1:21 pm

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

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Jun 21, 2008 9:50 am

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. :/

link2009
Retired
Posts: 390
Joined: Fri Aug 10, 2007 5:59 pm
Location: POrTal
Contact:

Post by link2009 » Sat Jun 21, 2008 10:25 am

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
Image
-Vecinu de la Patru

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Jun 21, 2008 11:23 am

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. :)

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sat Jun 21, 2008 12:20 pm

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.

link2009
Retired
Posts: 390
Joined: Fri Aug 10, 2007 5:59 pm
Location: POrTal
Contact:

Post by link2009 » Sat Jun 21, 2008 2:55 pm

Okay, I'll need to take a look into this. I'll tell you what results I get.
Image
-Vecinu de la Patru

chrrox
Content Designer
Posts: 177
Joined: Wed Oct 17, 2007 8:12 pm

Post by chrrox » Sat Jun 21, 2008 7:33 pm

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.

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Sun Jun 22, 2008 8:22 am

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!

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Post by Zcoretri » Sun Jun 22, 2008 10:19 am

Yeah I'm one of those making a tool for myself. Decided to give VB.NET a try, been using VB6 forever, lol.
Image

User avatar
John Adams
Retired
Posts: 9684
Joined: Thu Jul 26, 2007 6:27 am
EQ2Emu Server: EQ2Emulator Test Center
Characters: John
Location: Arizona
Contact:

Post by John Adams » Tue Jun 24, 2008 6:35 pm

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. ;)

User avatar
Zcoretri
Team Member
Posts: 1642
Joined: Fri Jul 27, 2007 12:55 pm
Location: SoCal

Post by Zcoretri » Tue Jun 24, 2008 11:08 pm

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.
Image

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests