我有一个DataTable
的列,如# of Students
,并想按此降序排序。这里是我的代码:如何使用DataTable.Select()访问具有特殊字符的列?
...
dt.Columns.Add(new DataColumn("# of Students", typeof(string)));
// do some stuff... add records etc.
// A runtime error occurs here: "Cannot find column '# of Students'"
var rows = dt.Select("","'# of Students' desc");
// this is just fine.
rows = dt.Select("","# of Students");
如何访问此列,如果它的名称中有特殊字符?
男人我是个假人!这对我来说应该更加明显。谢谢! – DJTripleThreat 2012-04-10 00:30:53