Link to home
Create AccountLog in
Avatar of rawilken
rawilkenFlag for United States of America

asked on

Returning Fields

I have a view in SQL Server 2005. In ASP.NET I have a method that returns the totals for two fields in that view. I now want a control that will return certain fields with their data (there will be several records).

The method that returns the Totals is...
        private decimal GetTotalsBilling(
            TradingPerspectiveType tradingPerspective, string sideTypeName, TotalsType totals)
        {
            IEnumerable<TagSummaryView> items =
                this.TagSummaryItems.Where(
                    view => view.TradingPerspective == TradingPerspectiveType.Billing && view.Name == sideTypeName);
            return items.Sum(view => totals == TotalsType.Principal ? view.Principal : view.Quantity);
        }


I modified the view to display the fields/properties in the TagSummaryView as ...
        private string GetContract(string sideTypeName)
        {
            IEnumerable<TagSummaryView> items =
                this.TagSummaryItems.Where(
                    view => view.TradingPerspective == TradingPerspectiveType.Contract && view.Name == sideTypeName);
            return items.ToString();
        }


Clearly wrong to all except me.

The fields I want to return include TagTypeName, Quantity, Principal.
ASKER CERTIFIED SOLUTION
Avatar of rawilken
rawilken
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer