Re: MySql.Data.MySqlClient Namespace in ASP.Net
I've got the same problem. I use ASP.NET Webmatrix to create asp.net pages. I have included the assemblie and he still gives me the following error: Type 'MySqlConnection' is not defined.
This is my code:
================================================================
<%@ Page Language="VB" Debug="true" %>
<%@ import Namespace="MySql.Data.MySqlClient"" %>
<script runat="server">
Sub Button1_Click(s As Object, e As EventArgs)
Dim conAangifte as MySqlConnection
ConAangifte.MySqlConnection = "Server=localhost;Database=aangifte;User ID=sa;Password=test;" ' dit statement op één regel
Dim cmdInsertBurger
cmdInsertBurger.MySqlCommand
Dim MySqlAangifte
MySqlAangifte.MySqlString
' verbinding leggen en openen
conAangifte.Open()
'Blauwdruk voor Insert-statement samenstellen.
MySqlAangifte = "INSERT burger (naam) " & _
"VALUES (@b_naam)"
' Instantieren en Parameters vervangen
cmdInsertBurger.MySqlCommand(MySqlAangifte, conAangifte)
cmdInsertBurger.Parameters.Add("@b_naam", txtNaam.Text)
' SQL statement uitvoeren en doorsturen naar volgende pagina
cmdInsertBurger.ExecuteNonQuery()
conAangifte.Close()
response.redirect("bedankt.aspx")
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<h2>Uw gegevens
</h2>
<p>
Naam:<asp:TextBox id="txtNaam" runat="server"></asp:TextBox>
</p>
<p>
<br />
<asp:BUtton id="Button1" onclick="Button1_Click" runat="server" Text="Verzenden"></asp:BUtton>
</p>
</form>
</body>
</html>
================================================================
Please help me! What am i doing wrong. I am using the mysql.net connector....
Subject
Written By
Posted
Re: MySql.Data.MySqlClient Namespace in ASP.Net
January 03, 2005 11:35AM
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.