473,803 Members | 3,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataSet Iteration?

Hi All,

What is the most acceptable way of iterating through a DataSet Tables Row
Collections Manually?
As in:

'fill data adapter object with dataset info
Da = New SqlDataAdapter( Cmd)
Da.Fill(Ds)

'iterate through Area Grouops
Do While() ????

'create new drop down list item
lstItem = New ListItem()
lstItem.Text = " -" & rdrAssessmentAr eas("name")
lstItem.Value = rdrAssessmentAr eas("assmnt_are a_id")

'add new list item to drop down list
ddlAssessmentAr eas.Items.Add(l stItem)

Loop

Cheers,
Adam

Nov 19 '05 #1
3 1927
I'd suggest something along these lines:

For Each row As DataRow in MyDataSet.Table s(0).Rows
lstItem.Text = row("name").ToS tring()
Next

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Adam" <ad**@pertrain. com.au> wrote in message
news:eS******** ******@TK2MSFTN GP15.phx.gbl...
Hi All,

What is the most acceptable way of iterating through a DataSet Tables Row
Collections Manually?
As in:

'fill data adapter object with dataset info
Da = New SqlDataAdapter( Cmd)
Da.Fill(Ds)

'iterate through Area Grouops
Do While() ????

'create new drop down list item
lstItem = New ListItem()
lstItem.Text = " -" & rdrAssessmentAr eas("name")
lstItem.Value = rdrAssessmentAr eas("assmnt_are a_id")

'add new list item to drop down list
ddlAssessmentAr eas.Items.Add(l stItem)

Loop

Cheers,
Adam

Nov 19 '05 #2
I'd suggest something along these lines:

For Each row As DataRow in MyDataSet.Table s(0)
lstItem.Text = row("name").ToS tring()
Next

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Adam" <ad**@pertrain. com.au> wrote in message
news:eS******** ******@TK2MSFTN GP15.phx.gbl...
Hi All,

What is the most acceptable way of iterating through a DataSet Tables Row
Collections Manually?
As in:

'fill data adapter object with dataset info
Da = New SqlDataAdapter( Cmd)
Da.Fill(Ds)

'iterate through Area Grouops
Do While() ????

'create new drop down list item
lstItem = New ListItem()
lstItem.Text = " -" & rdrAssessmentAr eas("name")
lstItem.Value = rdrAssessmentAr eas("assmnt_are a_id")

'add new list item to drop down list
ddlAssessmentAr eas.Items.Add(l stItem)

Loop

Cheers,
Adam

Nov 19 '05 #3
Beautiful!

Thanks.

"Steve C. Orr [MVP, MCSD]" <St***@Orr.ne t> wrote in message
news:uN******** ******@TK2MSFTN GP14.phx.gbl...
I'd suggest something along these lines:

For Each row As DataRow in MyDataSet.Table s(0).Rows
lstItem.Text = row("name").ToS tring()
Next

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Adam" <ad**@pertrain. com.au> wrote in message
news:eS******** ******@TK2MSFTN GP15.phx.gbl...
Hi All,

What is the most acceptable way of iterating through a DataSet Tables Row
Collections Manually?
As in:

'fill data adapter object with dataset info
Da = New SqlDataAdapter( Cmd)
Da.Fill(Ds)

'iterate through Area Grouops
Do While() ????

'create new drop down list item
lstItem = New ListItem()
lstItem.Text = " -" & rdrAssessmentAr eas("name")
lstItem.Value = rdrAssessmentAr eas("assmnt_are a_id")

'add new list item to drop down list
ddlAssessmentAr eas.Items.Add(l stItem)

Loop

Cheers,
Adam


Nov 19 '05 #4

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

Similar topics

35
3757
by: Raymond Hettinger | last post by:
Here is a discussion draft of a potential PEP. The ideas grew out of the discussion on pep-284. Comments are invited. Dart throwing is optional. Raymond Hettinger ------------------------------------------------------------- PEP: 323
1
3632
by: Mac | last post by:
I'm trying to validate input from an xml source to a dataset in dotnet2.0. As far as I can see, type errors correctly cause an exception, but values that are the correct type but do not satisify xsd:restriction conditions are ingested without a murmur. Is this a bug or a feature? Very frustrating. Evidence: 1) XML data <?xml version="1.0" encoding="utf-8"?>
8
3273
by: David | last post by:
Hi all, Using C# 1.1 I have a dataset loaded from an XML file. The idea being that if the app (a winform app that relies on a webservice) is offline, then I save data locally in XML and update the web service later. So, when I update, I have something like...
5
6445
by: justanothernewbie804 | last post by:
hi all. I have a dataset and would like to do something like "select distinct field1, field2 from fields" against the dataset. I do not have the option of creating a new database table and selecting from that table. Nor do I have the option of changing how the dataset is populated. I need to select distinct from the dataset that I have. Any suggestions?
5
2746
by: bob | last post by:
Hi, My app needs to read a text file, compare the data to that already stored in the DB and generate a text file of the differences. The UI displays the text file data and the db data in a series of Datagridviews. Piclk a row in the text file master table dgv and the other dgvs move to the appropriate records so you can eyeball the differences before generating the difference file.
3
2847
by: Ken Fine | last post by:
This is a question that someone familiar with ASP.NET and ADO.NET DataSets and DataTables should be able to answer fairly easily. The basic question is how I can efficiently match data from one dataset to data in a second dataset, using a common key. I will first describe the problem in words and then I will show my code, which has most of the solution done already. I have built an ASP.NET that queries an Index Server and returns a...
0
813
by: Rob Meade | last post by:
Hi all, I have the following xml file... <?xml version="1.0" encoding="utf-8" ?> <Assembly> <!-- ' The name of the product/application/resource.
3
6806
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
In Visual Studio 2005, I have my DataSet filled with several static tables (they might get changed weekly, but that's about it). With one of these tables in the DataSet, is it possible to select distinct items? Ex: I want to fill a tree with a list of job titles, and the Employee table isalready filled with all of our employee records. Is there a way I could do something like this below?
13
4527
by: madankarmukta | last post by:
Hi all, Is there any way by which I can export the data from the dataset table to the text file or xls file ? Currently I implemented this by itterating through each row of the table and writting the data to file.I want to avoid iteration.It occured to me bcoz skipping iteration will improve the performance. Please Help.. Thanks!
0
9703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9564
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10548
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10316
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9125
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6842
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5500
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3798
muto222
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.