rikkie
8/12/2002 7:32:00 PM
I got this error code Compiler Error Message: BC30002:
Type 'Microsoft.data.Odbc.OdbcConnection' is not defined.
Using this asp.net code anyone who can tell me what´s wrong
<%@ Page Language="VB" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="Microsoft.Data.Odbc" %>
<script runat="server">
Sub Page_Load(Sender As Object, E As EventArgs)
' TODO: Update the ConnectionString and
CommandText values for your application
Dim ConnectionString As String = "DSN=FREIGHTWARE"
Dim CommandText As String = "select RELATIONCODE
FROM RELATION"
Dim myConnection As New
Microsoft.data.Odbc.OdbcConnection(ConnectionString)
Dim myCommand As New OdbcCommand(CommandText,
myConnection)
myConnection.Open()
DataGrid1.DataSource = myCommand.ExecuteReader
(CommandBehavior.CloseConnection)
DataGrid1.DataBind()
End Sub
</script>
<html>
<head>
</head>
<body style="FONT-FAMILY: arial">
<h2>Simple Data Report
</h2>
<hr size="1" />
<form runat="server">
<asp:datagrid id="DataGrid1" runat="server"
CellSpacing="1" GridLines="None" CellPadding="3"
BackColor="White" ForeColor="Black"
EnableViewState="False">
<HeaderStyle font-bold="True"
forecolor="white" backcolor="#4A3C8C"></HeaderStyle>
<ItemStyle backcolor="#DEDFDE"></ItemStyle>
</asp:datagrid>
</form>
</body>
</html>