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 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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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
|
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"?>
|
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...
|
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?
|
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.
| |
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...
|
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.
|
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?
|
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!
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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...
|
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();...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |