.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

how to create and use session variables!!!

Posted By: krishna     Posted Date: August 04, 2012    Points:5   Category :C#
in my code, i want to store selected comp_code and com_name(array), and these two variables are used anywhere in my code??

Responses
Author: Deco             
Posted Date: August 06, 2012     Points: 20   

You can store the value in the session variable using the below code sample

Session["CompCode"] = comp_code;
Session["ComName"] = com_name;


You can retrieve the values back from the session using below sample

string compcode = Convert.ToString(Session["CompCode"]);
Array myArray = (Array)Session["ComName"];


Regards,
Deco
Author: BitWise             
Posted Date: August 24, 2012     Points: 20   

Use Session Variables to create it..
Session["comp_code"] = comp_code;
Session["comp_name"] = comp_name;

Now you can use it by...

int code = (int)Session["comp_code"];
int[] ar = (int[])Session["comp_name"];


BitWise


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend