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?
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=
Dim MyConnection As New OdbcConnection(MyConString
MyConnection.Open()
End Sub
End Class
So what have I done wrong?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.