displaying footer on another table

Posted by Jammyhunt under ASP.NET on 2/28/2013 | Points: 10 | Views : 883 | Status : [Member] | Replies : 6
Greets everybody



i have a salary table like this

table1(gridview)

sl.no name salary

1 raj 1000

2 aman 1200

3 khan 900

4 jammy 1100

total 4200

now i want to show footer of this table to a new table

like this

sl.no name total_salary

1 total 4200

how to do this?




Responses

Posted by: Santhi on: 3/1/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

Do you want to insert the footer value to another table?
or do you want to show the footer value in your UI?


Thanks & Regards,
Santhi .V

Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jammyhunt on: 3/1/2013 [Member] Starter | Points: 25

Up
0
Down
i want to insert footer value to another table
btw what do u mean by UI

Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Santhi on: 3/1/2013 [Member] Starter | Points: 25

Up
0
Down
Hi

You have to calculate the sum of salary and you need to store the sum of salary in another table right.
Try this query
INSERT INTO  secondtablename                          (marks)

SELECT SUM(salary) AS Expr1
FROM firsttablename

you need to calculate the sum of salary from the first table then insert it into the second table


UI is nothing just designing. User interface.

Thanks & Regards,
Santhi .V

Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oswaldlily on: 3/1/2013 [Member] Starter | Points: 25

Up
0
Down
Get Your footer values like below :




DropDownList ddlProj = (DropDownList)gv.FooterRow.FindControl("ddlProjf");
string _value=ddlProj .SelectedValue;


now u pass this value into another table

Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Oswaldlily on: 3/1/2013 [Member] Starter | Points: 25

Up
0
Down
Yu can try this way also...
insert into table2('name' , 'tot_salary') select name,salary from table1 where name='total'

set your S.No to autoincrement



Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Jammyhunt on: 3/15/2013 [Member] Starter | Points: 25

Up
0
Down
i didnt understand it properly, will you explain it to me more... @ santhi

Jammyhunt, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response