Solved

c# Connecting to MySql

Posted on 2007-04-09
7
258 Views
Last Modified: 2012-08-14
Connecting to MySql Server.

I had this table "CV" which countain all the info about the people that send their cv.
"FName,LName, Domain, Expertise ..." on a Sql Server 2000 but the license expired so I decided to move to MySql as its free and its seems to be more and more present right now.

im trying to code a connection to it using c#.NEt "visual studio 2003". But i can't seem to find how to add the ressource "using blablabla...;" so that i worked. i tried using the Connector/ODBC 3.51, using the .NET API but nothing seems to work.

Id like to use dataset, how would be the best way to do it? i search mysql.org, did research on google as well tried many tutorials but noon worked.
0
Comment
Question by:PetitSinge
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 35

Expert Comment

by:Raynard7
ID: 18878793
Hi,

I would recommend that you use the .net connector - and use the examples on the help files for it provided by mysql.  I have not had a problem using c# with mysql - the only problem I have had however is that you must manage your connections solely through code - you can not use the gui to create and hold your datasets..
0
 

Author Comment

by:PetitSinge
ID: 18879905
by .net you mean the Microsoft .net solution or the MySql .net?

I have try installing the .net had problem loading them into the project.
0
 
LVL 35

Accepted Solution

by:
Raynard7 earned 125 total points
ID: 18880058
the mysql.net connector - you should just be able to reference the dll, and not even have to install the package
0
Webinar: MongoDB® Index Types

Join Percona’s Senior Technical Services Engineer, Adamo Tonete as he presents “MongoDB Index Types, How, When and Where Should They be Used?” on Wednesday, July 12, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

 

Author Comment

by:PetitSinge
ID: 18881960
ok, i've download "mysql-connector-net-5.0.6-noinstall.zip" which seems to be the newest version.
I unzipped the file "MySql.Data.dll" into my project bin\release directory.
I try to add the file ot my Reference "Right Click on Reference" in the Solution Explorer, "Add Reference".
In that window i browse all 3 types of reference ".NET .COM Project" but wenever i click ok after selecting the file MySql.Data.dll i get the error message

"A Reference to *dllpath\MySql.Data.dll* could not be added, this is not a valid assembly or COM component. Only assembly with .dll extension  and COM component can be referenced. Please make sure the file is accessible, and that its a valid assembly or COM component."
0
 

Author Comment

by:PetitSinge
ID: 18882464
I also tried to compile the source code of the MySQL .net connector

but got the error "Unable to read the project file "MySql.Data.2005.csproj". the file "d:\path\MySql.Data.2005.csproj" is not a valid project file. The project file is missing the "VisualStudioProject" section.
0
 

Author Comment

by:PetitSinge
ID: 18882532
Was wondering if the fact that my version of Visual Studio is 2003 if this could be the reason i can't load the dll into my project?

there must be some ressource for visual studio 2003 as well too. I hope.
0
 

Author Comment

by:PetitSinge
ID: 18884875
well seems like the version .net 2.0 isn't working with MS Studio 2003.
had to find the version MySql.net 1.1 "mysql-connector-net-1.0.9" rather then "mysql-connector-net-5.0.6"
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question