I've got a MySQL database running on my laptop and I want to connect to it via some C# scripting.
I have an aspx page that has this at the top:
But I get an error when I try to open this page:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="MySql.Data.MySqlClient" %>
void Page_Load(object sender, System.EventArgs e)
MySql.Data.MySqlClient.MySqlConnection con = new MySql.Data.MySqlClient.MySqlConnection();
I'm assuming that if I have MySQL running on my machine, I have the MySql.Data.MySqlClient library. If so, I can I get my aspx page to access it. If not, how do I get it (and then use it)?
Compiler Error Message: CS0246: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)
Line 3: <%@ Import Namespace="System.Data" %>
Line 4: <%@ Import Namespace="MySql.Data.MySqlClient" %>
Line 6: <html>