Solved

How to access MYSQL database using  C#

Posted on 2010-08-24
7
499 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 to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now