:sad:
I am trying to connect to a mysql database. ideally, i'd like it dumped into a grid view so i can edit it... no matter how i try it, i get this error-

Compiler Error Message: BC30002: Type 'ODBCConnection' is not defined.
here is the code for this page:

<%@ page language="VB" Debug=true %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="Microsoft.Data.Odbc" %>
<HTML>
<HEAD>
<SCRIPT Language="VBScript" Runat="server">
Sub Page_Load(Source as object, e as EventArgs)
Dim sConnection = "DRIVER={MySQL ODBC 3.51 Driver};" _ 
& "SERVER=localhost;" _ 
& "DATABASE=db;" _ 
& "UID=BrowserName;" _ 
& "PWD=bfakepass;" _ 
& "OPTION=3" 
'& 1 + 2 + 8 + 32 + 2048 + 16384 
Dim oConnection as ODBCConnection = new ODBCConnection(sConnection)
Dim sSQL as String = "SELECT FirstName, LastName FROM addresses"
Dim oDataAdapter as ODBCDataAdapter = New ODBCDataAdapter(sSQL, oConnection)
Dim oDataSet as DataSet = new DataSet()
oDataAdapter.Fill(oDataSet)
oDataGrid.DataSource = oDataSet
oDataGrid.DataBind()
End Sub
</SCRIPT >
</HEAD>
<BODY>
<ASP:DataGrid ID="oDataGrid" Runat="server" />
</BODY>
</HTML>

Did you import namespace System.Data.Odbc?

Btw. You did not declare sConnection as string.

Dim sConnection As String

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.