Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8828899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:42:42+00:00 2026-06-14T07:42:42+00:00

I am using a class public partial class CashFlowIndicator:IEnumerable { public static void getCashFlowChartValues(int

  • 0

I am using a class

public partial class CashFlowIndicator:IEnumerable
{
    public static void getCashFlowChartValues(int userid)
    {
            List<KeyValuePair<string, string>> chartValues=new List<KeyValuePair<string,string>>();
            chartValues = cashFlowChart(userid);
    }    

    public static List<KeyValuePair<string, string>> cashFlowChart(int userid)
    {
              //.............................
              //..................................
            List<KeyValuePair<string, string>> cashFlowItems = new List<KeyValuePair<string, string>>();
            cashFlowItems.Add(new KeyValuePair<string, string>(a, b));
            cashFlowItems.Add(new KeyValuePair<string, string>(c, d));
           //.....................    

            return cashFlowItems;
     }    
}

The problem is while calling the function cashFlowChart, the variable “chartValues” is not getting assigned by the value returned…..

is there any solution?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:42:44+00:00Added an answer on June 14, 2026 at 7:42 am

    Based on the method name – “getCashFlowChartValues”, and return type – “void”, here is my guess –

    you need to move the definition of “chartValues” outside the methods and make it ‘static’ (as shown below) :

    public class CashFlowIndicator :IEnumerable
    {
    
        static List<KeyValuePair<string, string>> chartValues;  // has been moved here from getCashFlowChartValues
    
        public static void getCashFlowChartValues(int userid)
        {
                //List<KeyValuePair<string, string>> chartValues=new List<KeyValuePair<string,string>>();
                chartValues = cashFlowChart(userid);
        }    
    
        public static List<KeyValuePair<string, string>> cashFlowChart(int userid)
        {
                //.............................
                //..................................
                var cashFlowItems = new List<KeyValuePair<string, string>>();
    
                cashFlowItems.Add(new KeyValuePair<string, string>(a, b));
                cashFlowItems.Add(new KeyValuePair<string, string>(c, d));
            //.....................    
    
                return cashFlowItems;
        }    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public class TestBL { public static void AddFolder(string folderName) { using (var ts =
I am creating a tempfile using C#. public partial class frmResults : Form {
The winform: The code: using System; using System.Windows.Forms; namespace DemoApp { public partial class
Im using DataContractJsonSerializer to serealize this class: public class User { public string id
Using simple type like class A { public int X, Y; } with object
I'm using the following mapping: public class LoadMap : IAutoMappingOverride<Load> { public void Override(AutoMapping<Load>
I have this class: public partial class Window1 : Window { public String Name2;
suppose I have a class like class ABC { int ID; public string Name;
This is my entity class: public partial class NerdDinnerEntities : ObjectContext { public NerdDinnerEntities(string
public partial class Form1 : Form { public disp(string strVal) { lbl1.text = strVal;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.