473,395 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

MysqlConnection is not defined

Hi,

I need to access data from Mysql database with asp.net 2.0.
I installed the Mysql/Connector Net 1.1.
I did this:
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)

Dim myConnection As MySqlConnection
....

This gives an error: "MysqlConnection is not defined"

Any idea how to solve this?
Thanks
Chris
May 10 '06 #1
4 2083
"Chris" <cc*@sdsd.dc> wrote in message
news:e4**************@TK2MSFTNGP04.phx.gbl...
Any idea how to solve this?


Add a reference to MySql in your project.
May 10 '06 #2
First, you need a project reference, which will solve this issue. Second,
you really should code in a Code Behind (Code Beside for 2.0) file instead
of embedded in the page, as it fosters separation of code and UI>

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"Chris" <cc*@sdsd.dc> wrote in message
news:e4**************@TK2MSFTNGP04.phx.gbl...
Hi,

I need to access data from Mysql database with asp.net 2.0.
I installed the Mysql/Connector Net 1.1.
I did this:
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)

Dim myConnection As MySqlConnection
....

This gives an error: "MysqlConnection is not defined"

Any idea how to solve this?
Thanks
Chris

May 10 '06 #3
Thanks both for replying.
I already use code-behind, but for keeping it simple here, i put it in one
file.

But, sorry if it"s stupid, what do you mean with "you need a project
reference"?


"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:u2**************@TK2MSFTNGP02.phx.gbl...
First, you need a project reference, which will solve this issue. Second,
you really should code in a Code Behind (Code Beside for 2.0) file instead
of embedded in the page, as it fosters separation of code and UI>

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"Chris" <cc*@sdsd.dc> wrote in message
news:e4**************@TK2MSFTNGP04.phx.gbl...
Hi,

I need to access data from Mysql database with asp.net 2.0.
I installed the Mysql/Connector Net 1.1.
I did this:
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)

Dim myConnection As MySqlConnection
....

This gives an error: "MysqlConnection is not defined"

Any idea how to solve this?
Thanks
Chris


May 10 '06 #4
I'm working with VWD, and there, in my project, i did: Add reference.
In the window, i can see a lot of things, but nothing about Mysql ....

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamM> wrote in
message news:u2**************@TK2MSFTNGP02.phx.gbl...
First, you need a project reference, which will solve this issue. Second,
you really should code in a Code Behind (Code Beside for 2.0) file instead
of embedded in the page, as it fosters separation of code and UI>

--
Gregory A. Beamer

*************************************************
Think Outside the Box!
*************************************************
"Chris" <cc*@sdsd.dc> wrote in message
news:e4**************@TK2MSFTNGP04.phx.gbl...
Hi,

I need to access data from Mysql database with asp.net 2.0.
I installed the Mysql/Connector Net 1.1.
I did this:
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace = "System.Data" %>
<%@ Import Namespace = "MySql.Data.MySqlClient" %>
<script language="VB" runat="server">
Sub Page_Load(sender As Object, e As EventArgs)

Dim myConnection As MySqlConnection
....

This gives an error: "MysqlConnection is not defined"

Any idea how to solve this?
Thanks
Chris


May 10 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Antonio Concepcion | last post by:
Hi! After you close the SQL Connection using MySQLConnection.Close Do you still need to do a dispose as in: MySQLConnection.Dispose and also MySQLCommand.Dispose?
0
by: nthpixel | last post by:
Hey Folks, I am getting the following errors when I try to connect to my db with the MySqlConnection. I added MySql.Data to my Reference list and have the .dll in my bin directory. I also have...
2
by: Bill | last post by:
Hi, I try to connect to Mysql using the Mysql Connector 1.0.7. with asp.net 2.O. In "mysql.aspx", i put: <%@ import namespace="System.Data"%> <%@ Import Namespace = "MySql.Data.MySqlClient"...
2
by: curious2007 | last post by:
During the linking I get the following: 1>Linking... 1>main.obj : error LNK2005: "double __cdecl sigma(class curious2007::pair<double,double> const &)" (?sigma@@YANABV?$pair@NN@curious2007@@@Z)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.