473,406 Members | 2,619 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

database sums.

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

SqlConnection myConnection = new
SqlConnection("server=1.1.1.1;uid=;pwd=;database=m dMuseumStore");
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.
Nov 15 '05 #1
1 1116
modify 'tbtemp_purchase' to some appropriate SQL.

"Vincent Jones" <vn****@hotmail.com> wrote in message
news:ba**************************@posting.google.c om...
I have this connection
void Page_Load(Object sender, EventArgs e)
{

SqlConnection myConnection = new
SqlConnection("server=1.1.1.1;uid=;pwd=;database=m dMuseumStore");
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.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: guyzdancin | last post by:
I have developed a parsing program to handle large csv files and compute sums. The program was developed and successfully tested using only String objects. I want replace String objects with ...
34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
4
by: Wayne Aprato | last post by:
I have a simple database which was originally written in Access 97. When converted to Access 2000 file format it ran flawlessly in Access 2002. I've just tried to run it in Access 2003 and I am...
9
by: rinmanb70 | last post by:
I have a table of transactions, some with past dates, some dated the current date, and some dated in the near future. On a report, I'm looking for a way to get four different sums using the...
8
by: DrewKull | last post by:
Hello, I have a query which sums check boxes (so 0 or -1) then Abs the sum so i can get the number of check box 'checked' per column... based on start and end date. SELECT Abs(Sum(CommCon)) AS ,...
4
by: onecorp | last post by:
I have a SQL table comprised of 31 columns. The first column is simply an id column, the next 30 columns are labelled ,.... The numerical columns have a tinyint type and the data stored is either...
3
by: tpdinh | last post by:
I have to evaluate the sum in the for-loop. How do i do that? Also, I need to print the partial sums using %e. Please help!
1
by: wisemen | last post by:
I have a table with 2 columns, and .I want to run a query that will give me a cumulative sum of the no. of entries that have an <= and on the second column give me a cumulative sum of the no. of...
2
by: Asembereng | last post by:
want to read from a database using php commands and grouping by timetype jobdatefrom endyear and nctype and summing the groups for everymonth but instead it sums up for all the months. Here are the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.