Solved

c# Connecting to MySql

Posted on 2007-04-09
7
257 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
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.

 

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

733 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