473,385 Members | 1,341 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,385 software developers and data experts.

ASPX database connection problem

********************
My code:
********************
<%@ Page Language="VB" debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>

<script language="VB" 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;" & _
"Data Source=c:\ASPNET\data\banking.mdb")

'open connection
dim objCmd as OleDbDataAdapter = 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:12pt verdana;color:darkred">
<i><b><%# DataBinder.Eval
(Container.DataItem, "FirstName")%>&nbsp;
<%# 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, "Zip") %><br>
<b>Phone: </b><%# DataBinder.Eval _
(Container.DataItem, "Phone") %><br>
</div>
</ItemTemplate>
</ASP:DataList>
</body></html>
****************************************
Here is the error message I received:
*******************************************
No error information available: 0x800401F9.
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: No
error information available: 0x800401F9.

Source Error:
Line 16: 'fill dataset
Line 17: dim ds as DataSet = new DataSet()
Line 18: objCmd.Fill(ds, "tblUsers")
Line 19:
Line 20: 'select data view and bind to server control
Source File: C:\Inetpub\wwwroot\AspNet\21Days\day08
\listing0801.aspx Line: 18

Stack Trace:
[OleDbException (0x800401f9): No error information
available: 0x800401F9.]
System.Data.OleDb.OleDbConnection.ProcessResults(I nt32
hr) +20
System.Data.OleDb.OleDbConnection.CreateProviderEr ror
(Int32 hr) +23
System.Data.OleDb.OleDbConnection.CreateProvider
(OleDbConnectionString constr) +107
System.Data.OleDb.OleDbConnection.Open() +203
System.Data.Common.DbDataAdapter.QuietOpen
(IDbConnection connection, ConnectionState& originalState)
+44
System.Data.Common.DbDataAdapter.FillFromCommand(O bject
data, Int32 startRecord, Int32 maxRecords, String
srcTable, IDbCommand command, CommandBehavior behavior)
+304
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet,
Int32 startRecord, Int32 maxRecords, String srcTable,
IDbCommand command, CommandBehavior behavior) +77
System.Data.Common.DbDataAdapter.Fill(DataSet dataSet,
String srcTable) +36
ASP.listing0801_aspx.Page_Load(Object Sender, EventArgs
e) in C:\Inetpub\wwwroot\AspNet\21Days\day08
\listing0801.aspx:18
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

Nov 17 '05 #1
0 1010

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

Similar topics

11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
13
by: Larry | last post by:
Hi I have asp.net programs. I used a very simple data transfer method by using URLs ˇ°First.aspxˇ± contents a line to send data to the ˇ°second.aspxˇ± page, for
4
by: Vladimír Kolesnik | last post by:
Hi there, does anybody know, how to create a class, which is can be inherited by both aspx (System.Web.UI.Page) as well as by ascx (System.Web.UI.UserControl) classes. I have the bunch of same...
4
by: Nathaniel Sherman | last post by:
Alright, folks, here's the deal... I'm working on migrating a classic ASP website to an ASP.NET codebase. At the heart of the site is a MySQL database. To make sure an "in-process" program...
14
by: Mark B | last post by:
Our webhost (www.usbusinessweb.net) had a W2K IIS5 server crash after a scheduled hard-boot occurred during a ms-security patch install overnight. They couldn't get the server working again so they...
0
by: Eustice Scrubb | last post by:
In line coding problem. Here's my code: <script language="VB" runat="server"> Dim myConnection As SqlConnection Sub Page_Load(Src As Object, e As EventArgs) ' Create a connection to the SQL...
1
by: bennett | last post by:
I'm trying to write an ASPX page that uses an OleDbDataAdapter to get data from a SQL Server database. When I test the connection, it returns success, and when I preview the data using the...
0
by: malcolm | last post by:
Hi, I have 2 issues with the code I am using. I am unable (at the moment) to convert from ASP to ASPX and wondering if the following code could be easily converted to ASP ? <asp:Label...
3
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable...
3
by: LamSoft | last post by:
I am not going to write a aspx to connect a SQL Server... but it tries to connect the SQL Server... Some of the Code.. protected void LoginButton_Click(object sender, EventArgs e) { if...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.