获取DataGird的列名
/// <summary>
/// 获取DataGrid的列名
/// </summary>
/// <param name="dt"></param>
/// <returns></returns>
protected string[] getDTCol(System.Data.DataTable dt)
{
string cols = string.Empty;
for (int i = 0; i < dt.Columns.Count; i++)
{
cols += (dt.Columns[i].ColumnName + ",");
}
cols = cols.TrimEnd(',');
return cols.Split(',');
}
/// 获取DataGrid的列名
/// </summary>
/// <param name="dt"></param>
/// <returns></returns>
protected string[] getDTCol(System.Data.DataTable dt)
{
string cols = string.Empty;
for (int i = 0; i < dt.Columns.Count; i++)
{
cols += (dt.Columns[i].ColumnName + ",");
}
cols = cols.TrimEnd(',');
return cols.Split(',');
}