Link to home
Start Free TrialLog in
Avatar of mrbryanejones
mrbryanejones

asked on

MySQL connector namespace error in Visual Studio 2003

I'm totaly new to .Net but have done a course and have a book. Installed the MySQL .net Connector and have Visual Studio 2003 running on my computer.

I know I need an import statement to get the MySQL connector to work and have added the text below but just get a squiggley line underneath and a namespace not found error message.

Imports System.Data.Odbc
Imports MySql.Data.MySqlClient

Public Class WebForm2
    Inherits System.Web.UI.Page

    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Put user code to initialize the page here
        Dim myconstring = New mysqlconnection("Database=log;Data Source=192.168.0.11;User Id=root")
        Dim MyConnection As New OdbcConnection(MyConString)
        MyConnection.Open()
    End Sub

End Class



So what have I done wrong?

ASKER CERTIFIED SOLUTION
Avatar of laotzi2000
laotzi2000

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mrbryanejones
mrbryanejones

ASKER

Now I feel like a complete numpty.

That worked fine. For the record and people searching this in the future I should note there are samples in the install directory of the MySQL connector.