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

Moving through a Dataset

hi,

i'm trying to cycle through a dataset to test if a row/column in a grid
is the same as in the dataset.

Just wondering if there's an easier way, the recordsets in old ado/asp
seemed much easier to use and datareaders only being forward only is a
pain. Dataset are very complex too.

Code Below:

int i=0;
foreach(DataRow r in dayDS.Tables("Day_Bookings").Rows)
{
int tester = Convert.ToInt32(r["intID"].ToString());
if(tester==row)
{

}
i++;
}
Old style asp:

// begin the cycle to see if there is a booking for this cell
while(!bookings.EOF)
{
if(bookings("room")==roomsarray[col]) //if the room is the same as the
col
{
if(bookings("period") == row) //if the period is the same as the row
{
openCell();
htmlcode+= bookings("staff").value; //print the staff who has the
booking to the cell
closeCell();
printed = true; //a value has been printed for the cell
}

}
bookings.MoveNext(); //move to the next record of bookings
} //end cycle of bookings
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 2805
Isn't this less code that asp? Why is it a pain?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Mark" <Ma********@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
hi,

i'm trying to cycle through a dataset to test if a row/column in a grid
is the same as in the dataset.

Just wondering if there's an easier way, the recordsets in old ado/asp
seemed much easier to use and datareaders only being forward only is a
pain. Dataset are very complex too.

Code Below:

int i=0;
foreach(DataRow r in dayDS.Tables("Day_Bookings").Rows)
{
int tester = Convert.ToInt32(r["intID"].ToString());
if(tester==row)
{

}
i++;
}
Old style asp:

// begin the cycle to see if there is a booking for this cell
while(!bookings.EOF)
{
if(bookings("room")==roomsarray[col]) //if the room is the same as the
col
{
if(bookings("period") == row) //if the period is the same as the row
{
openCell();
htmlcode+= bookings("staff").value; //print the staff who has the
booking to the cell
closeCell();
printed = true; //a value has been printed for the cell
}

}
bookings.MoveNext(); //move to the next record of bookings
} //end cycle of bookings
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

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

Similar topics

3
by: Simon | last post by:
Hi everyone, I have a small problem regarding a wizard that I'm making on my website. The wizard is obviously a series of pages that take values from the user. My question is: - Should I...
3
by: genojoe | last post by:
I have tried everything I can think of to move records from one Access database to another. It should not be that hard. Read on.... I have identical access mdb's. One contains data; one...
5
by: Sam | last post by:
Hi, I have a datagrid which datasource is a dataset. I want to add a spin button to my form so that when the user click on the up arrow, the selected row in the grid will be moved up by one (same...
7
by: Dale Sampson | last post by:
As you can tell, I am new to VS.net. I have a VB project with a defined data source pointing to a table in a ..mdb file.-- The associated fields are displayed in textboxes using the...
3
by: UJ | last post by:
I've got a working web service that we are moving to another machine and now I suddenly get the following error. While transferring the files, got the following message:...
3
by: Don Miller | last post by:
In my migration from ASP to ASP.NET 2.0, I have a fair number of complicated HTML tables that defy anything .NET can do. Using classic ASP I created these tables (by string concatenation) by moving...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
In a database search application (vb2005), the user wants to be able to scroll through records using the mousewheel. The data display form contains textboxes for the main data and a datagridview...
0
by: Ed Sonneveld | last post by:
I am moving some of my VS 2003 projects to VS 2005. In my base library there is a baseform that is inherited by most forms in my application. The baseform in the library contains a protected...
1
by: Michel | last post by:
Hello, I need to calculate moving averages of weekly data during the last year. After some search, I believe that the best approach will be to get a dataset from the SQL Server database, browse...
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...
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.