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

Need help in programmatically accessing the data returned by data access method...

Hi,
In my ASP.Net 2.0 app, I have a gridview whose data is being
populated using an object data source which retrieves data from a data
access layer. The Select method returns a static list of orders. The
order contains a bunch of data retrieved from SQL server.
I do display only a part of them in my Gridview by using
<asp:BoundField. I do , however need to access the remaining fields
which are part of the order programmatically from my codebehind file.
Can anyone help with how I can go about doing that?

Thanks
-Siva Ramaswami

Apr 17 '06 #1
1 1745
Siva...

You didn't say what specific class the "object data source" belongs to. As
long as it's not database attached (like a SqlDataReader, for example), you
should be able to simply set a reference to it, in code-behind, and access
any data it contains via that reference. If you need that data on subsequent
round-trips, just persist the reference in session state.

By some definitions, a "data access layer" is stateless, which might mean
that it will be up to you to persist any data that it returns (potentially,
placing a reference in session state would still be sufficient). You
indicated that "The Select method returns a static list of orders". If it is
an ArrayList, for example, you just need to declare an arraylist and code
your call to the Select method to return its results to that reference.
Then, set the DataSource property of your GridView to that same reference.

So, determine what class you are dealing with, and go from there.

HTH
--
Richard Laird, MCSD.NET
"Siva" wrote:
Hi,
In my ASP.Net 2.0 app, I have a gridview whose data is being
populated using an object data source which retrieves data from a data
access layer. The Select method returns a static list of orders. The
order contains a bunch of data retrieved from SQL server.
I do display only a part of them in my Gridview by using
<asp:BoundField. I do , however need to access the remaining fields
which are part of the order programmatically from my codebehind file.
Can anyone help with how I can go about doing that?

Thanks
-Siva Ramaswami

Apr 17 '06 #2

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

Similar topics

4
by: u7djo | last post by:
Hi, I'm currently building an application in Access and as part of this need to import forms and modules from another database. Some of the imports will be revisions of existing forms/modules so I...
1
by: Martine | last post by:
Hi there! I have a problem with programmatically adding user controls to my mobile webforms. If I load my usercontrol programmatically (in the Page_Load), the object is instantiated, I have...
2
by: EddieG | last post by:
I am having a problem accessing changed values in TextBoxes returned via the OnUpdaterow event. Using C# I access the control using: string _txtAmt = ((TextBox)e.Item.FindControl("txtAmount")).Text ...
9
by: cj | last post by:
I'm trying to forge ahead with Visual Basic .Net but recently I've suffered several major set backs in demonstrating VB is the future and we should move from Visual FoxPro. I really need to find...
3
by: Paul | last post by:
I am using Visual Studio.net 2005 (and asp.net 2.0) Let's say that in a Web Project, I have created a (Dataset?) called SomeDataset.xsd. On it I have a TableAdapter called SomeTableTableAdapter...
1
by: Mark Stafford | last post by:
I am attempting to use a DetailsView control to view some data where the fields returned by the database are determined at runtime. I create the TemplateFields on the fly using a class that...
10
by: perplexed | last post by:
After a user logs in (ASP.NET 2.0 membership/roles), how do I programmatically access their UserId and other information stored in the ASP.NET database structure? A user may login at Login.aspx...
2
by: Orit | last post by:
Hello . Please find below my questions - I hope some of the ASP.NET experts of this forum will answer to those beginner's questions : My Web site should be able to work with either SQL Server...
1
by: carled | last post by:
Hi all. New here and new to .net from classic asp. I have to access an xml-rpc webservice in .net and it's making my brain fry trying to get it all set up. I'm most comfortable with vb, but I can...
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...
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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...
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.