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:
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)?
I have an aspx page that has this at the top:
Code:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="MySql.Data.MySqlClient" %>
<html>
<script runat="server">
void Page_Load(object sender, System.EventArgs e)
{
MySql.Data.MySqlClient.MySqlConnection con = new MySql.Data.MySqlClient.MySqlConnection();
}
</script>
But I get an error when I try to open this page:
Code:
Compiler Error Message: CS0246: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)
Source Error:
Line 2:
Line 3: <%@ Import Namespace="System.Data" %>
Line 4: <%@ Import Namespace="MySql.Data.MySqlClient" %>
Line 5:
Line 6: <html>
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)?