Solved

How to access MYSQL database using  C#

Posted on 2010-08-24
7
502 Views
Last Modified: 2013-12-17
What´s the better way to access MYSQL databes using c# (2008-Visual Studio) for web application?
0
Comment
Question by:Jose Bredariol
7 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 100 total points
ID: 33510153
0
 
LVL 20

Assisted Solution

by:alainbryden
alainbryden earned 50 total points
ID: 33510165
You should first try using the ODBC driver.

Details for connecting to MYSQL in C# using ODBC can be found here: http://www.geekpedia.com/tutorial139_Connecting-to-MySQL-with-Csharp-and-ODBC.html

--
Alain
0
 
LVL 5

Assisted Solution

by:Akin Delu
Akin Delu earned 50 total points
ID: 33510677
i will advice you go for MySQL-ConnectorNet as sedqwick said,
ODBC adds an extra layer to the execution and the execution would be slow.
ODBC does not releasing the connections immediately after object disposition.
0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 8

Assisted Solution

by:Mohit Vijay
Mohit Vijay earned 50 total points
ID: 33510688
You can install MYSQL ODBC Driver for .NET.

After that you can specify the connection string in web.config, here is an example...

<connectionStrings>      
    <add name="MySQLConnectionString" connectionString="Driver={MySQL ODBC 3.51 Driver};uid=<Username>;password=<password>;Server=<ServerName, It can be 'localhost'>;Option=16834;Database=<Database Name>;"/>
  </connectionStrings>
0
 
LVL 42

Assisted Solution

by:sedgwick
sedgwick earned 100 total points
ID: 33510698
you can download the MYSQL to .NET connector here: http://dev.mysql.com/downloads/connector/net/
0
 
LVL 14

Expert Comment

by:systan
ID: 33510903
0
 

Author Closing Comment

by:Jose Bredariol
ID: 33544812
Thanks All
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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