Solved

c# Connecting to MySql

Posted on 2007-04-09
7
254 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
  • 5
  • 2
7 Comments
 
LVL 35

Expert Comment

by:Raynard7
Comment Utility
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
Comment Utility
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
Comment Utility
the mysql.net connector - you should just be able to reference the dll, and not even have to install the package
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:PetitSinge
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now