473,324 Members | 2,124 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,324 software developers and data experts.

Reading MS Access Tables

I can connect to SQL Server and read any table data but
can't do so with MS Access 2000 (9.0.2720)

Here is a sample code.

on the webForm.aspx page I have the following web server
control:

<asp:dropdownlist id="roomList" runat="server">
</asp:dropdownlist>

In the webForm.aspx.cs file (the file behind the scenes)
I have the following code..

As a class level variable I have the following:
OleDbConnection conn;
DataSet ds;
OleDbDataAdapter daRooms;
Inside the InitializeComponent() method, I initialize the
connection string as follows:

this.conn = new OleDbConnection();
this.conn.ConnectionString
= "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\\Inetpub\\wwwroot\\WebApp\\mydatabase.md b"
Now within the Page_Load() event handler I have..

conn.Open();
daRooms = new OleDbDataAdapter("SELECT * FROM Rooms",
conn);
daRooms.Fill(ds, "Rooms");
roomList.DataSource = ds.Tables["Rooms"];

if(!this.IsPostBack){
this.DataBind();
}
conn.Close();


When I run the application, instead of seeing the room
names within the <asp:dropDownList> control, I see the
following:

System.DataRow.DataView
I see one such line for each room name that is in the
database table, Rooms

Can someone please tell me why? What am I doing wrong?

thanks,
Prince
Nov 15 '05 #1
1 1332
pr******@cox.net wrote:
Can someone please tell me why? What am I doing wrong?


Your DropDownList has several properties you need to set.

DataMember: the name of the table you want to bind the list to. This is
required only if your DataSource contains multiple tables.

DataTextField: the name of the field within the bound table you wish to
display.

DataTextFormatString: the formatting picture to use in when displaying
data from the field specified in DataTextField

DataValueField: the name of the field which provides the value
associated with each text entry in the DropDownList.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
Nov 15 '05 #2

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

Similar topics

1
by: Boris Wilhelms | last post by:
Hello all, at first, sorry for my bad English, I’ll give my best  We have a strange problem reading Text- and VarChar-Fields. Our configuration: -Windows 2003 Server -MySQL Server 3.23.36...
3
by: Carl Lindmark | last post by:
*Cross-posting from microsoft.public.dotnet.languages.csharp, since I believe the question is better suited in this XML group* Hello all, I'm having some problems understanding all the ins and...
3
by: Jon Ole Hedne | last post by:
My Access 2002-application need to work with tables from both Oracle and Access. To solve this, I want to run some querys on three views in Oracle and import the results into temporary...
2
by: Konstantinos | last post by:
How to use composite keys? How do they migrate as FKs, how to input them from a form etc... Cheers! Konstantinos
1
by: Mr. B | last post by:
VB.net 2003 c/w Framework 1.1 and MS Access db We have a commercial program that does our Acounting and Time Sheets (Timberline). At least once a day our Accounting department runs a Script...
1
by: Shmuel Shulman | last post by:
Hi I have 2 funny probs that are probably related 1. I can't read the entire field from a dbf file it cuts it at some point (see below) 2. When I use Access or SQL server to read these...
1
by: hzgt9b | last post by:
(FYI, using VB .NET 2003) Can someone help me with this... I'm trying to read in an XML file... it appears to work in that the DataSet ReadXML method dose not fail and then I am able to access the...
4
by: Vanessa | last post by:
Hi there I am an Access developer, and I have written applications for a 30 telephone call center, using the standard multiuser jet engine, it all works fine, but I want to move our systems onto...
10
by: Stephen Plotnick | last post by:
I've started some code but do not know how to get the anwser. Here is the code: I need the first four characters of data in a field (TextName) to get a name from a DB and put the name back into...
2
by: Steve | last post by:
I have zero experience with ODBC. If I have an Access frontend connected to a SQL Database using ODBC, are the tables connected like a frontend/backend Access database where the the tables you see...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.