ASP.NET problem - Creating dataset

G

Guest

Hi All - I am an experienced ASP developer but am new to ASP.NET and the .NET
framework and am trying to learn how to access datasets.

When I try to build the following page, I get the errow below. I've
reviewed my code over and over and looked for similar errors/information on
the web but I can't seem to find what the problem is, and therefore I can't
come up with a solution. Can anyone help me? Thanks in advance...

Page (am hitting a local Access db/table, which does have records):
<%@ Page Language="VB" Debug="True"%>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script runat="server">
sub Page_Load(Sender as Object, e as EventArgs)
'set up connection
dim ObjConn as new OleDbConnection ("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"DataSource=c:\Inetpub\wwwroot\aspbook\data\banking.mdb")

'open connection
dim ObjCmd as new OleDbDataAdapter("select * from tblUsers", objConn)
'fill dataset
dim ds as DataSet = new DataSet()
ObjCmd.Fill(ds, "tblUsers")

'select data view and bind to server control
MyDataList.DataSource = ds.Tables("tblUsers").DefaultView
MyDataList.DataBind()
end sub
</script>

<html><body>
<ASP:DataList id="MyDataList" RepeatColumns="2" RepeatDirection="Vertical"
runat="server">
<ItemTemplate>
<div style="padding:15,15,15,15; font-size:10pt; font-family:Verdana">
<div style="font:12 pt verdana; color:darkred">
<i><b>
<%# DataBinder.Eval(Container.DataItem, "FirstName")%>
<%# DataBinder.Eval(Container.DataItem, "LastName")%>
</i></b>
</div>
<br>
<b>Address: </b><%# DataBinder.Eval(Container.DataItem, "Address")%><br>
<b>City: </b><%# DataBinder.Eval(Container.DataItem, "City")%><br>
<b>State: </b><%# DataBinder.Eval(Container.DataItem, "State")%><br>
<b>ZIP: </b><%# DataBinder.Eval(Container.DataItem, "ZipCode")%><br>
<b>Phone: </b><%# DataBinder.Eval(Container.DataItem, "Phone")%><br>
</div>
</ItemTemplate>
</ASP:DataList>
</body></html>

Error:
Could not find installable ISAM.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.Data.OleDb.OleDbException: Could not find
installable ISAM.

Source Error:


Line 14: 'fill dataset
Line 15: dim ds as DataSet = new DataSet()
Line 16: ObjCmd.Fill(ds, "tblUsers")
Line 17:
Line 18: 'select data view and bind to server control
 
N

Nelson Xu

Use this to replace what you have originally:
dim ObjConn as new OleDbConnection
("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"DataSource=c:\Inetpub\wwwroot\aspbook\data\banking.mdb;"
& _
"User ID=Admin; Password=")

Regards,

Nelson
message news:0374AF5C-6174-4474-8ABC- (e-mail address removed)... to ASP.NET and the
..NET errors/information and therefore I
can't
("Provider=Microsoft.Jet.OLEDB.4.0;" &
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top