database sums.

V

Vincent Jones

I have this connection
void Page_Load(Object sender, EventArgs e)
{

SqlConnection myConnection = new
SqlConnection("server=1.1.1.1;uid=;pwd=;database=mdMuseumStore");
SqlDataAdapter myCommand = new SqlDataAdapter("SELECT * from
Paintings_vw", myConnection);
DataSet ds = new DataSet();
myCommand.Fill(ds, "tbtemp_purchase");
MyRepeater.DataSource = ds.Tables["tbtemp_purchase"].DefaultView;
MyRepeater.DataBind();
}

and this display..
<ASP:Repeater ID="MyRepeater" runat="server">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "Title")%><br>
<%# DataBinder.Eval(Container.DataItem, "Description")%><br>
<%# DataBinder.Eval(Container.DataItem, "Price", "{0:c}") %><br>
</ItemTemplate>
</ASP:Repeater>

... but i want to display the sum of the price.
thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top