View Single Post
  #6 (permalink)  
Old February 5th, 2004, 10:12 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

This code will return the name from the second row in the table in the dataset. The index are zero based, so Row[1] means the second row.

You can think of the Table in a DataSet like a normal table, or a spread sheet. It's divided in Rows and Columns:
Code:
DataTable myTable = idsInvoices.Tables["ClientInvoices"]

FullName = myTable.Rows[0]["FullName"].ToString() // returns FullName of first record
FullName = myTable.Rows[1]["FullName"].ToString() // returns FullName of second record
AnotherValue = myTable.Rows[0][0].ToString() // returns the first column for the first record
Take a look here: http://msdn.microsoft.com/library/de...gdatatable.asp and the articles around this one for more info.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Reply With Quote