Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有 LINQ 查询:
var product_view = from productallinfo in QProductAllInfo select productallinfo;
然后我将数据加载到表中
MainCatalog_Table.DataSource = product_view.Distinct();
接下来我想按列名对数据进行排序,例如“ProductName”
为什么不在将其绑定到 DataSource 之前对其进行排序,如下所示:
var product_view = from productallinfo in QProductAllInfo orderby productallinfo.ProductName select productallinfo;
然后你将它绑定到你的数据源......