RETREIVE DATA FROM BO OBJECT TO SESSION VARIABLES

Total Post:1

Points:7
C# 
C#
 1722  View(s)
Ratings:
Rate this:
Hi All,

I need to save the values of BO object into session variables after logged in successfully to the website.

Here is my code:  
IList<ConfigurationMaster> pConfigurationMaster = BLLConfigurationCountryandState.Instance.GetConfiguration();
                        Session[ConfigEnum.Country.ToString()] = new KeyValuePair<string, string>(pConfigurationMaster[0].ConfigNameId, pConfigurationMaster[0].ConfigValue);
                        Session[ConfigEnum.State.ToString()] = new KeyValuePair<string, string>(pConfigurationMaster[1].ConfigNameId, pConfigurationMaster[1].ConfigValue);
                        Session[ConfigEnum.City.ToString()] = new KeyValuePair<string, string>(pConfigurationMaster[2].ConfigNameId, pConfigurationMaster[2].ConfigValue);
                        Session[ConfigEnum.AcademicYear.ToString()] = pConfigurationMaster[3].ConfigValue;
 
Here i don't want to use the pConfigurationMaster[index].configvalue;

It's very urgent.Any one please help me in this. 

-Sindhu.A
  1. Post:40

    Points:280
    Re: retreive data from BO object to session variables

    Hi,


    If you don't want to use pConfigurationMaster[index].configvalue you can store pConfigurationMaster directly to Session instead of storing its value through index.

      Modified On Mar-29-2018 05:03:15 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!