Solved

c# Connecting to MySql

Posted on 2007-04-09
7
255 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

777 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