GridView: Calculated Field

S

sck10

Hello, I am using the following DataSource with a GridView. My question is
how do I show the calculated field in a GridView for the following:

RevenueQtr01 + RevenueQtr02 + RevenueQtr03 + RevenueQtr04 AS
strActualRevenue

--
Thanks in advance,

sck10


SQL String Data Source
-------------------------
<asp:SqlDataSource ID="dsCustRevListQuery" runat="server"
ConnectionString="<%$ ConnectionStrings:cnnFundTrack %>"
SelectCommand="
SELECT
CustomerRevenue_ID,
ServiceName,
Customer,
Region,
RevenueQtr01 + RevenueQtr02 + RevenueQtr03 + RevenueQtr04 AS
strActualRevenue,
RevenueImpactType,
RevenueYear,
AnnualForecastRevenue
FROM tblServicePortfolio_Customer_Revenue
WHERE (ServiceName = @ServiceName)
ORDER BY RevenueYear DESC, Customer, Region, RevenueImpactType">
<SelectParameters>
<asp:ControlParameter
ControlID="gvSearchList"
DefaultValue="NoParameter"
Name="ServiceName"
PropertyName="SelectedValue"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
 
W

Walter Wang [MSFT]

Hi,

Thank you for posting!

Based on my understanding, a calculated field is just like a normal field
except it cannot be used for updating. During DataBinding, it will show in
the GridView just as the other fields. So I'm not quite clear about the
issue here. Would you mind telling me more information about it? So that we
can work on it together. Thanks.

Regards,

Walter Wang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top