shaik irshad sharif shaik irshad sharif - 1 month ago 12
MySQL Question

ASP and MySQL connectivity

Is there a way to access mysql database using connection string in ASP.Net application?

<ConnectionString>
<add name=""
providerName=""
connectionString="" />
</ConnectionString>

Answer

You need to first have MySql .Net connector plugin installed in your system. If you don't have, get it and install it: http://dev.mysql.com/downloads/connector/net/

Then you can simply define your connection string as below:

<add name="MySQLCnn" connectionString="server=[SERVER Address];User Id=[Your Username];password=[Your Password];database=[Database Name]" providerName="MySql.Data.MySqlClient" />

Here is a simple code which will help you in through this way: http://www.aspsnippets.com/Articles/Use-and-connect-to-MySQL-Database-in-ASPNet-Application-using-MySQLConnector.aspx

Comments