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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Read a datatable

Status
Not open for further replies.

Westond

Programmer
Jan 19, 2005
43
US
Hey guys,

I have a dt in c# and all I am tring to do is read the records out of it.??

label1 = dt.Rows[0].Table.Column["field"]; something like that .. How do I get the value of "field" to display in the label?

Thanks

Wes
 
This is one way...

Code:
dt.Rows[0][1].ToString();
That will write out the data from the second column of the first row.

----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top