473,473 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Access DataSource in code

I'm just starting out with VWD 2008, and new to ASP .NET.

I have a master page which displays one record for an Access database
based on an ID number in the query string. Then I have a content page
that displays some other records which are also filtered by that ID.
I'd like to do just one query in the master page, which returns all
fields for that main record, then just use those fields in the details
page instead of doing a seperate query.

On the master page I currently have a DetailsView, hooked to an
ObjectDataSource, hooked to a TableAdapter for the Access table that
has the main record I'm displaying details for on the master page.
The query in the TableAdapter returns all rows "select *" even though
I only show some in the DetailsView... so can I (and how) access that
data in one or more content pages? As of now I don't even know how to
access the data in the master page, because I don't see any properties/
methods of ObjectDataSource that return anything with "Rows" and
"Fields".
Jun 27 '08 #1
3 1263
On 28 May, 00:42, eselk2...@gmail.com wrote:
I'm just starting out with VWD 2008, and new to ASP .NET.

I have a master page which displays one record for an Access database
based on an ID number in the query string. *Then I have a content page
that displays some other records which are also filtered by that ID.
I'd like to do just one query in the master page, which returns all
fields for that main record, then just use those fields in the details
page instead of doing a seperate query.

On the master page I currently have a DetailsView, hooked to an
ObjectDataSource, hooked to a TableAdapter for the Access table that
has the main record I'm displaying details for on the master page.
The query in the TableAdapter returns all rows "select *" even though
I only show some in the DetailsView... so can I (and how) access that
data in one or more content pages? *As of now I don't even know how to
access the data in the master page, because I don't see any properties/
methods of ObjectDataSource that return anything with "Rows" and
"Fields".
Hi

If I understand you correctly you want to know how to get the Master
page within scope of the content page?

In the source code (.aspx file) of the content page you need to add a
line at the top beneath the @page directive something like this:
<%@ MasterType virtualpath=" (path to your master page) " %>

You will then find that an object named Master becomes accessible
including any properties, variable declarations or procedures/
functions with a public attribute, from within the content page.
Jun 27 '08 #2
On May 27, 7:41*pm, Stan <googles...@philhall.netwrote:
If I understand you correctly you want to know how to get the Master
page within scope of the content page?
That was part of my question, but I guess the main issue is still:
On 28 May, 00:42, eselk2...@gmail.com wrote:
As of now I don't even know how to access the data in the master page,
because I don't see any properties/methods of ObjectDataSource that
return anything with "Rows" and "Fields".
Jun 27 '08 #3
On May 28, 7:55*am, eselk2...@gmail.com wrote:
As of now I don't even know how to access the data in the master page,
because I don't see any properties/methods of ObjectDataSource that
return anything with "Rows" and "Fields".
I figured this out, and I'm using this code now, which works:

Dim dv As DataView = Master.dsSubscriber.Select()
Dim row As DataRowView = dv.Item(0)
Dim min_prior As Integer = row("MinPrior")

But, can anyone tell me if the Select() call generates another trip to
the database? I have a control which displays the data already, and
it is already bound when I call Select(), so in that case does Select
just come from a cache? I haven't looked at the caching options yet,
but I think those are related to caches between multiple requests, and
in this case I'm just wondering about caching within one request (one
load of the page).
Jun 27 '08 #4

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

Similar topics

5
by: rob | last post by:
Hi to all. I am pretty new to using Access and am having a problem I hope someone can help me with. I want to access a MS-Access database from a web page. I have managed to get it "sort" of...
6
by: Ecohouse | last post by:
I have a computer with XP on it. I loaded Office 97 first because I needed Access 97 for some work. I then loaded Office 2000. Everything seemed to be running fine. But I have come across a few...
9
by: Neil Ginsberg | last post by:
I have a strange situation using Access to automate a Word mail merge. Using Access 2000 and Word 2000, the code opens Word, opens the document in Word, sets a table in the calling Access...
2
by: | last post by:
Hello All, I am having a lot of difficulty trying to bind a templated column, that is programmatically created for a datagrid, to a datasource column. I have a datasource containing 2 columns,...
1
by: Gert Albertse | last post by:
When I try to update my access database, nothing get updated. Here is my code: <%@ Page Language="VB" Debug="true" %> <script runat="server"> ' Insert page code here ' Function...
12
by: Selva Chinnasamy | last post by:
Hi I am using batch commands against Ms-Access and getting an error Message "Characters found after end of SQL statement." String Here is my sql Dim str_screens As String = "Select * from Screens...
15
by: philip | last post by:
On a form, I have a datagridview. This datagridview is constructed on a dataset filled by a tableadapter. The table adapter do very well what it must do when filling dataset. Insertions,...
3
by: eagleofjade | last post by:
I am trying to help a friend who is learning VB.net in school. I have done VB programming for a number of years using VB 6. He needs to open a query in an Access database that has parameters so he...
2
by: zalek | last post by:
Hello, I wrote a program that is working OK which access DB2 using the following code: String w_conn = "jdbc:db2:DB2MAIN; Class.forName("COM.ibm.db2.jdbc.app.DB2Driver"); Connection db2Conn...
6
by: Wesley Peace | last post by:
I hate to cross post, but I've gotten no answer yet on a problem I'm having with visual studio 2008. I've created a series of forms with controls to access a Access database tables. The...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.