Connect to MySql (asp.net)

shdus1

New Member
Messages
108
Reaction score
2
Points
0
I am not to familiar with asp.net. Where do you put the code to connect to MySql databases in asp.net. Which file do you put the code in, and where in the file?
 

Submariner

New Member
Messages
44
Reaction score
1
Points
0
ASP.NET normally stores the connection string information in the web.config file. They are contained as a child element under the connectionStrings element.
<connectionStrings>
<add name="ConnectionStringName" providerName="System.Data.SqlClient" connectionString="Server=localhost;Database=pubs;Trusted_Connection=true" />
</connectionStrings>

The name/value pairs in the connectionString attribute are specific to the providerName class. This examle is for a SQL Server connection. I'm not sure what all the MySQL takes from ASP.NET.

James
 
Top