• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 513
  • Last Modified:

How to access MYSQL database using C#

What´s the better way to access MYSQL databes using c# (2008-Visual Studio) for web application?
0
Jose Bredariol
Asked:
Jose Bredariol
5 Solutions
 
alainbrydenCommented:
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
 
Akin DeluI’m a software engineer, tech enthusiast and UI/UX lover. Commented:
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
Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
Mohit VijayCommented:
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
 
Meir RivkinFull stack Software EngineerCommented:
you can download the MYSQL to .NET connector here: http://dev.mysql.com/downloads/connector/net/
0
 
Jose BredariolPMPAuthor Commented:
Thanks All
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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now