开发者

How to get distinct rows of datatable by any particular column?

I am getting a table in asp.net with sql server. I wanna get all distinct rows according to a single column. I am using .net 2.0 .

I am using "ToTable" method of dataview but it is giving distinct rows according to all column. My code is here.

DataTable dt1 = dt.DefaultView.ToTable(true, new string[] {"productid", "sizetitle", "exprice","price", "sizeID" });

I wanna get distinct rows according to sizeid column. Where sizeid is distinct. But many rows my price and exprice have distinct value then it is giving multiple sizeid rows.

Please suggest m开发者_高级运维e. Thanks in advance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜