MySQL connector namespace error in Visual Studio 2003

Posted on 2005-03-20
Medium Priority
Last Modified: 2008-03-06
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=;User Id=root")
        Dim MyConnection As New OdbcConnection(MyConString)
    End Sub

End Class

So what have I done wrong?

Question by:mrbryanejones
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 12

Accepted Solution

laotzi2000 earned 200 total points
ID: 13586556
You should also add a reference to the mysql assembly in your project.

Author Comment

ID: 13586764
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.

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question