Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do you reference a column?

Status
Not open for further replies.

needscoop

Programmer
Nov 13, 2002
29
US
How does one reference the name of a particular column
in the given row?

Assume the 3rd column contains the OrderNumber. Want to do a control-break when different value is detected in the OrderNumber column.


foreach(DataRow myRow in myTable.Rows)
{
if CntlNbr <> myRow[&quot;OrderNumber&quot;].???? ....
 

foreach(System.Data.DataRow dr1 in dta.Rows)
{
MessageBox.Show(dr1.ItemArray[2].ToString());
}


That would show a message box for each value in the 3rd column.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top