TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Zvonimir Filipovic
NA
6
0
SUM the fields in DataGrid
Nov 13 2007 8:41 AM
Hi
was wondering if anybody could help me. I was maid stored procedure as following:
USE [Spacva]
GO
/****** Object: StoredProcedure [dbo].[Test] Script Date: 11/13/2007 11:12:51 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Test]
(
@START_DATE smalldatetime,
@END_DATE smalldatetime
)
AS
BEGIN
SELECT VOZILA.ID_VOZILA, VOZILA.PROIZVODNI_POGON, VOZILA.NAZIV, VOZILA.TIP, VOZILA.REG,
SUM(TOCENJE.KOL_L) AS Quantity, SUM(TOCENJE.SATI_RADA) AS Hours, SUM(TOCENJE.PROSJEK_L_PO_H) AS Average
FROM VOZILA INNER JOIN
TOCENJE ON VOZILA.ID_VOZILA = TOCENJE.ID_VOZILA
WHERE (TOCENJE.DATUM_UNOSA BETWEEN CONVERT(SMALLDATETIME, @START_DATE, 104) AND CONVERT(SMALLDATETIME, @END_DATE, 104))
GROUP BY VOZILA.ID_VOZILA, VOZILA.PROIZVODNI_POGON, VOZILA.NAZIV, VOZILA.TIP, VOZILA.REG
END
That stored procedure I was include in my Windows C# Project, just drag and drop to Win Form. My question is, how to add footer in established DataGrid, I mean how to add SUM of all selected values from column Quantity to my DataGrid?
I'm new in SQL, Visual .NET, C# so thanks in advance for help!
Zvonimir
Reply
Answers (
2
)
WCF Windows Service (again!) - Service account
Managing Distributed Transactions with ADO.NET 2.0 using TransactionScope gives error message