trying to use MySql.Data.MySqlClient on aspx page
Posted by: Gibran Shah
Date: October 23, 2012 07:49PM

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:

<%@ 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:

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)?

Options: ReplyQuote


Subject
Written By
Posted
trying to use MySql.Data.MySqlClient on aspx page
October 23, 2012 07:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.