Difference between revisions of "Connect MySQL to ASP.Net Web App"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "==Install MySQL.Data== Using the Nuget Package Manager install the following: * MySql.Data; * MySql.Data.MySqlClient;")
 
(Install MySQL.Data)
Line 3: Line 3:
 
* MySql.Data;
 
* MySql.Data;
 
* MySql.Data.MySqlClient;
 
* MySql.Data.MySqlClient;
 +
 +
==Creating the connection==
 +
Now using the page you want to connect, open the Model `cs` code.
 +
 +
At the top add the following
 +
<syntaxhighlight lang=c#>
 +
using MySql.Data;
 +
using MySql.Data.MySqlClient;
 +
</syntaxhighlight>

Revision as of 19:24, 8 October 2024

Install MySQL.Data

Using the Nuget Package Manager install the following:

  • MySql.Data;
  • MySql.Data.MySqlClient;

Creating the connection

Now using the page you want to connect, open the Model `cs` code.

At the top add the following

using MySql.Data;
using MySql.Data.MySqlClient;