Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2360
  • Last Modified:

Connect to MySQL through Web.Config

I've connected to MS access in my asp.net pages by linking to the web.config like this:
web.config:
<appSettings>
<add key="DSN" value="Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\Inetpub\wwwroot\Text\mydb.mdb" />      
</appSettings>

 Page:
Dim objConn As New OleDbConnection(ConfigurationSettings.AppSettings("DSN"))

I'm now using MySQL for my db and ASP.NET 2.0 but I'm not sure how to do this now.  Can someone help me with this?
0
azyet24
Asked:
azyet24
1 Solution
 
RedKelvinCommented:
try this
<add key="AdMentorConnString" value="Driver={MySQL ODBC 3.51 Driver};Server=localhost;Port=3306;Option=131072;Stmt=;Database=admentornet;Uid=root;Pwd=;" />

snippet from here
http://codeview.aspcode.net/asp.net/free%20apps/AdMentorNET/Web.config.aspx

RedK
0
 
RejojohnyCommented:
have a look at http://connectionstrings.com/?carrier=mysql for all kinds of connectionstring samples on how to connect to mysql

Rejo
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

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