Posts

Showing posts from January, 2013

Viewstate vs Session

Image
Currently i am working on Web Application for which i had to perform some research on storing values in web application Which one is best to be used, As we all known HTTP Protocol is State less. Page can't hold variable [Value] on post back. So let see the working and difference Viewstate vs Session ViewState and Session are used to stored value Syntax  :  Viewstate (“ VariableName ”) = “ Value ”  :   Session (“ VariableName ”) =  “ Value ”                 1. ViewState are only accessible to page.                 i.e. Page1.aspx has Viewstate("Var1") Same will not be accessible in Page2.aspx.                        Instead once you call Viewstate("Var1") in page2.aspx it will create new Viewstate         ...

Part 2 C# Syntax for VB.net

Part 2 C# Syntax for VB.net 1).Any Collection value has to be accessed using index for example ArrayList MyArrayList[0].ToString(); All Index has to be accesses using Square brackets 2). Even Integer Variable Can't be used directly without assign values Int16 intValue; Int16 intloop; for (intLoop = 0; intLoop <= 5;intLoop ++) { intValue += intLoop; } This will give compile time error. for intValue is not assigned before using. Code has to be ----> Int16 intValue =0; 3.Intization of Value or Calls using constructor using System.Collections; ArrayList MyArrayList = new ArrayList(); DataEntry MyDEntry = new DataEntry(); 4.All methods will end with () Open And Close Brackets Example : intValue.ToString(); 5.Defining Properties string myStringValue; public string AccountName { get { return myStringValue; } set { mystringValue= value; } } WriteOnly Property public string my...

Part-1 C# Syntax For VB.net Developer

Part-1 C# Syntax For VB.net Developer             Started working on C# for a change. Found it to be more interesting and more challenging than conventional Basics Langauge. To get break from routine work i started developing sample  application on c#. I am enjoy this more and more. Felt some of the programming experience has to be shared.     While developing found there some of the syntax changed and way they are defined are also changed.     I have started series of C# Syntax for VB.net Developers which may help you people too.    To Concatenate String + sign has to be used VB.net uses & it has been replaced with + Sign in C# All Variable define must have default value string strSQL =""; int32 intNumber =0; Comment in C# Single Line Comment  // Muti Line Comment /* */ Define Subroutines private void DoSomething { } Define Fu...