Re: MySql.Data.MySqlClient Namespace in ASP.Net
Posted by: Hans Raaijmakers
Date: January 03, 2005 11:35AM

I've got the same problem. I use ASP.NET Webmatrix to create 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
Dim MySqlAangifte

' verbinding leggen en openen


'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
End Sub

<form runat="server">
<h2>Uw gegevens
Naam:<asp:TextBox id="txtNaam" runat="server"></asp:TextBox>
<br />
<asp:BUtton id="Button1" onclick="Button1_Click" runat="server" Text="Verzenden"></asp:BUtton>

Please help me! What am i doing wrong. I am using the connector....

Options: ReplyQuote

Written By
October 06, 2004 02:12AM
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.