We Recommend

Accelerated C# 2008 Accelerated C# 2008
This book is both a rapid tutorial and a permanent reference. You’ll quickly master C# syntax while learning how the CLR simplifies many programming tasks. You’ll also learn best practices that ensure your code will be efficient, reusable, and robust. Why spend months or years discovering the best ways to design and code C# when this book will show you how to do things the right way, right from the start?


Posted By

czapata on 04/23/08


Tagged

dotnet


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

mtelligent


DataRow Column Iterator


Published in: C# 


  1. foreach(DataRow row in dr.Table.Rows)
  2. {
  3. int colCount=0;
  4. foreach(DataColumn column in dr.Table.Columns)
  5. {
  6. Response.Write(dr.Table.Columns[colCount].ColumnName + ": " + dr[column].ToString() + "<br />");
  7. colCount ++;
  8. }
  9. }

Report this snippet 

You need to login to post a comment.