1 foreach (DataRow rows in ds.Tables["dt"].Rows)//在datatable中遍历字段值 2 { 3 Object[] os = rows.ItemArray; 4 foreach (Object o in os) 5 { 6 Console.WriteLine(o);//输出到屏幕 7 } 8 }