Description:
Re: error message and registering the Connecter/net in the gobal assembley cache.
Problem:-
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30002: Type 'MySqlConnection' is not defined.
Source Error:
Line 6: Sub Page_Load(sender As Object, e As EventArgs)
Line 7:
Line 8: Dim myConnection As MySqlConnection
Line 9: Dim myDataAdapter As MySqlDataAdapter
Line 10: Dim myDataSet As DataSet
Why is it nessary to copy the "C:\Program Files\MySQL\MySQL Connector Net 1.0.7\bin\.NET 2.0\MySql.Data.dll" to "C:\Inetpub\wwwroot\bin" in order to get the connector working?
This is the vb example I am following:-
http://www.15seconds.com/issue/050407.htm
My isp have installed the connector but appear to be reluctant to copy the dll across.
Is this a fault?
What is "asp.net project" folder?
http://forums.mysql.com/read.php?38,60476,61646#msg-61646
What is the local bin folder?
http://forums.mysql.com/read.php?38,69866,69888#msg-69888
Regards
Mark
How to repeat:
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)
Dim myConnection As MySqlConnection
Dim myDataAdapter As MySqlDataAdapter
Dim myDataSet As DataSet
Dim strSQL As String
Dim iRecordCount As Integer
myConnection = New MySqlConnection("server=localhost; user id=15secs; password=password; database=mydatabase; pooling=false;")
strSQL = "SELECT * FROM mytable;"
myDataAdapter = New MySqlDataAdapter(strSQL, myConnection)
myDataSet = New Dataset()
myDataAdapter.Fill(myDataSet, "mytable")
MySQLDataGrid.DataSource = myDataSet
MySQLDataGrid.DataBind()
End Sub
</script>
<html>
<head>
<title>Simple MySQL Database Query</title>
</head>
<body>
<form runat="server">
<asp:DataGrid id="MySQLDataGrid" runat="server" />
</form>
</body>
</html>
Suggested fix:
Is the installation at fault or its just a manal copy?