hi
this is my tabel
Id
|
name
|
classification
|
Totalproduct
|
behcode
|
1
|
iron
|
Electric
|
|
1111
|
2
|
Vaccum cleaner
|
Electric
|
|
1111
|
3
|
Sofa
|
Furniture
|
|
1111
|
4
|
Scarf
|
Cloth
|
|
222
|
I have 2 column in my datalist and use this SP to show data from table
USE [behtop]
GO
/****** Object: StoredProcedure [dbo].[test5] Script Date: 06/21/2012 14:03:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[test5]
as
begin
select distinct Classification,count(Classification) TotalProduct
from House_p
where BehCode=1111
Group by Classification
end
So it show in my datalist this
classification
|
Totalproduct
|
Electric
|
2
|
Furniture
|
1
|
Now I need ID column in my datalist but when I change my SP and add id it didn’t work correctly it
USE [behtop]
GO
/****** Object: StoredProcedure [dbo].[test5] Script Date: 06/21/2012 14:03:18 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[test5]
as
begin
select distinct Classification,count(Classification) TotalProduct,ID
from House_p
where BehCode=1111
Group by Classification,ID
end
it show in my data list this
classification
|
Totalproduct
|
Electric
|
1
|
Electric
|
1
|
Furniture
|
1
|
When I use id column distinct didn’t work I need ID column what should I do to solve this problem?
Thanks