如何将Dense_rank数字插入数据表或gridview? [英] How to Insert Dense_rank numbers into the datatable or gridview ?
本文介绍了如何将Dense_rank数字插入数据表或gridview?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我必须使用c#代码而不是SQL来将Dense_rank数字插入数据表或gridview中。
例如在SQL中它可以是这样的,
I have to insert Dense_rank numbers into the datatable or gridview by using c# code and not by SQL.
e.g. In SQL it can be like this,
select *,DENSE_RANK() over (order by [FinalScore] desc) as rank2 from #Temp
但我必须用C#代码而不是SQL代码。
but I have to do it in C# code and not in SQL.
推荐答案
向数据表添加一个新列。
然后在数据表上运行一个循环并添加这些值。
Add a new column to the datatable.
Then run a loop over the datatable and add these values.
这篇关于如何将Dense_rank数字插入数据表或gridview?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文