请帮我转换为C#等价物 Dim dtData As DataTable = Session("Data")Dim aFilters = From oRow In dtData _Where oRow(i_oColumn.BaseColumnName) IsNot DBNull.Value _Select sFilter = _oRow.Field(Of String)(i_oColumn.BaseColumnName).Replace(""
Dim dtData As DataTable = Session("Data") Dim aFilters = From oRow In dtData _ Where oRow(i_oColumn.BaseColumnName) IsNot DBNull.Value _ Select sFilter = _ oRow.Field(Of String)(i_oColumn.BaseColumnName).Replace("""", "\""") _ Distinct Order By sFilter未经测试,但直接翻译(有些整理):
DataTable data = (DataTable)Session["Data"]; var filters= (from row in data.AsEnumerable() where !(row[i_oColumn.BaseColumnName] is DBNull) let result = (row.Field<string>(i_oColumn.BaseColumnName)) .Replace(@"""",@"\""") orderby result select result).Distinct();
但是,我怀疑:
where !row.IsNull(i_oColumn.BaseColumnName)
woulc更清楚