开发者

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

开发者 https://www.devze.com 2023-02-14 21:02 出处:网络
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 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

精彩评论

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