Solved

c# Connecting to MySql

Posted on 2007-04-09
7
256 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
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 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