0
是否有可能通过在DataTable保存单行而不进行迭代时提供列名来获取行值。如何通过在DataTable中提供列名来获取行值
foreach(DataRow row in dt.Rows)
{
string strCity = row["City"].ToString();
}
我需要像下面没有循环时,我们只有一排,
String cn=row["ColumnName"].ToString()
什么是行值?行包含列,所以你应该说你想要什么列 –
[DataRow:给定列名称选择单元格值]的可能重复(http://stackoverflow.com/questions/7119993/datarow-select-cell-value-by -a赋予列名称) – sr28