By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,230 Members | 2,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,230 IT Pros & Developers. It's quick & easy.

Reading single field values from a dataset

P: n/a
What is the best way to read single field values from a dataset? The dataset
is populated with a customer record, showing well in a gridview. But I also
want to read the single field values, like adress, phone, and so on.

Bjorn
Oct 7 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Oct 7, 7:42 pm, "Bjorn Sagbakken" <bjo-...@online.nowrote:
What is the best way to read single field values from a dataset? The dataset
is populated with a customer record, showing well in a gridview. But I also
want to read the single field values, like adress, phone, and so on.

Bjorn
for example, myDataSet.Tables[0].Rows[0][0]

it gives you a value of the first colum in the first row

Oct 7 '07 #2

P: n/a
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11*********************@o80g2000hse.googlegro ups.com...
On Oct 7, 7:42 pm, "Bjorn Sagbakken" <bjo-...@online.nowrote:
>What is the best way to read single field values from a dataset? The
dataset
is populated with a customer record, showing well in a gridview. But I
also
want to read the single field values, like adress, phone, and so on.

Bjorn

for example, myDataSet.Tables[0].Rows[0][0]

it gives you a value of the first colum in the first row
Thanks a lot. That was exactly what I was looking for.

Bjørn
Oct 7 '07 #3

P: n/a

Is it a strong or weak typed DataSet?

Let's say you have
EmployeeDS
with one table : Employee
and 3 columns
EmployeeID (int) , LastName (string) , FirstName (string)
Here is some pseudo code:
EmployeeDS ds = new EmployeeDS();

ds.Employee.AddNewEmployeeRow ( 101, "Smith" , "John") ;

.........

EmployeeDS.EmployeeRow row = ds.Employee.Rows[0] as EmployeeDS.EmployeeRow;
// friendly cast
if(null!=row)
{
int empid = row.EmployeeID;
}


"Bjorn Sagbakken" <bj*****@online.nowrote in message
news:69*********************@telenor.com...
What is the best way to read single field values from a dataset? The
dataset is populated with a customer record, showing well in a gridview.
But I also want to read the single field values, like adress, phone, and
so on.

Bjorn

Oct 8 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.