Sunday, February 19, 2012

asp:sqldatasource - sum and contains

I have an asp:sqldatasource which is bound to a gridview

In addition to this I would like it to
a) see if there is a specif row/ item in it (ie item_id = 10 for any of the rows it has received) as I conditionally want to show another item outside of the gridview subject to if it is in the gridview or not

b) show the sum of all the values within a certain column of returned rows

Many thanks

not quite sure I understand your question a) but I for question b)

select sum(quantity) from table where id = 1

will return the sum of the quantity which id column equal to 1

No comments:

Post a Comment