Solved

How to access MYSQL database using  C#

Posted on 2010-08-24
7
503 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
[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
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Securing WEBAPI on Azure 2 28
Calculating percentage 2 32
Multi-Column Repeater 3 29
aspx ascx, c# 7 20
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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