470,822 Members | 1,260 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,822 developers. It's quick & easy.

Unhandled exception error on Command object

I'm trying to do an easy display of a few fields from a MSAccess
database on an aspx page in vb.net, but I get an error at the
"cy.DataSource = Cmd.ExecuteReader()" line :
System.Data.OleDb.OleDbException: IErrorInfo.GetDescription failed with


<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Page Language="VB" debug="true"%>
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data
Dim Conn as new OleDbConnection(strConn)
Dim strSQL as string ="SELECT lid,name FROM local"
Dim Cmd as New OleDbCommand(strSQL,Conn)
dim cy
cy.DataSource = Cmd.ExecuteReader()
End Sub
<form runat="server">
<body bgcolor="#FFFFFF">
<asp:DataList id="cy" runat="server"
RepeatColumns="1" RepeatDirection="vertical"
</b> <b><a href=#<%#
<%# Container.DataItem("name")%>
</a></b> </ItemTemplate>

Jun 19 '06 #1
0 922

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Professor Frink | last post: by
7 posts views Thread by Chuck Hartman | last post: by
5 posts views Thread by Lucvdv | last post: by
5 posts views Thread by Simon Tamman {Uchiha Jax} | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.