Monday, October 31, 2016

aspdotnet-page3

16. What is Reflection in .NET?

Ans:   
Reflection is the feature in .Net, which enables us to get some information about object in runtime. That information contains data of the class. Also it can get the names of the methods that are inside the class and constructors of that object.


17. Where The Inheritence is useful? How we decide the situation of inheritence?

Ans:   
Mostly inheritance requires in large classes where every time searching and writing of same data is impossible. That case requires us to define some inherited functions methods n classes. Whenever they required they simply inherited from inheritance class where they are already defined along with their functionality to handling some other data pieces.


18. What happened when type url in address bar and press enter?

Ans:   
The url is break into four parts(i.e. ip addresses)first is protocol in use, 2nd host name or ip address, 3rd protocol port no., 4th actual file path


19. How to Insert a TextBox value in to Sql database using C#.Net coding? 

Ans:   
Assign the textbox value to a string than using sqlcommand in c# writing insert query . Insert the value into the database.
ex; sqlcommand cmd=new sqlcommand("insert into emp values ('"+textbox1.text+"'),con"); cmd.executenonquerry();


20. What is Microsoft Intermediate Language (MSIL)?

Ans:   
The .NET Framework is shipped with compilers of all .NET programming languages to develop programs. There are separate compilers for the Visual Basic, C#, and Visual C++ programming languages in .NET Framework. Each .NET compiler produces an intermediate code after compiling the source code. The intermediate code is common for all languages and is understandable only to .NET environment. This intermediate code is known as MSIL.




21. What is the role of the JIT compiler in .NET Framework?

Ans:   
The JIT compiler is an important element of CLR, which loads MSIL on target machines for execution. The MSIL is stored in .NET assemblies after the developer has compiled the code written in any .NET-compliant programming language, such as Visual Basic and C#. JIT compiler translates the MSIL code of an assembly and uses the CPU architecture of the target machine to execute a .NET application. It also stores the resulting native code so that it is accessible for subsequent calls. If a code executing on a target machine calls a non-native method, the JIT compiler converts the MSIL of that method into native code. JIT compiler also enforces type-safety in runtime environment of .NET Framework. It checks for the values that are passed to parameters of any method. For example, the JIT compiler detects any event, if a user tries to assign a 32-bit value to a parameter that can only accept 8-bit value.


22. What is difference between System.String and System.StringBuilder classes?

Ans:   
String and StringBuilder classes are used to store string values but the difference in them is that String is immutable (read only) by nature, because a value once assigned to a String object cannot be changed after its creation. When the value in the String object is modified, a new object is created, in memory, with a new value assigned to the String object. On the other hand, the StringBuilder class is mutable, as it occupies the same space even if you change the value. The StringBuilder class is more efficient where you have to perform a large amount of string manipulation.


23. What is the difference between VB.NET and C#?

Ans:   
Well this is the most debatable issue in .NET community and people treat languages like religion. It is a subjective matter which language is best. Some like VB.NET’s natural style and some like professional and terse C# syntaxes. Both use the same framework and speed is very much equivalents. Still let us list down some major differences between them:-
Advantages VB.NET:-
• Has support for optional parameters that makes COM interoperability much easy.
• With Option Strict off late binding is supported.Legacy VB functionalities can be used by using Microsoft.VisualBasic namespace.
• Has the WITH construct which is not in C#.
• The VB.NET parts of Visual Studio .NET compiles your code in the background. While this is considered an advantage for small projects, people creating very large projects have found that the IDE slows down considerably as the project gets larger.
Advantages of C#
• XML documentation is generated from source code but this is now been incorporated in Whidbey.
• Operator overloading which is not in current VB.NET but is been introduced in Whidbey.
• Use of this statement makes unmanaged resource disposal simple.
• Access to Unsafe code. This allows pointer arithmetic etc, and can improve performance in some situations. However, it is not to be used lightly, as a lot of the normal safety of C# is lost (as the name implies).This is the major difference that you can access unmanaged code in C# and not in VB.NET

24. What is Multi-threading? Did VB6 support multi-threading?

Ans:   
Multi-threading forms subset of Multi-tasking. Instead of having to switch between programs, this feature switches between different parts of the same program. Example you are writing in word and at the same time word is doing a spell check in background.
While VB6 supports multiple single-threaded apartments, it does not support a free-threading model, which allows multiple threads to run against the same set of data.

25. What are the steps to configure SQLServer mode?

Ans:   
Following are the things to remember so that SQLSERVER Mode works properly:-
• SQLSERVER mode session data is stored in a different process so you must ensure that your objects are serializable.
• IIS metabase (\LM\W3SVC\2) must be identical across all servers in that farm.
• By default Session objects are stored in “Tempdb”, you can configure it store outside “TempDB” by running Microsoft provided SQL script.





EmoticonEmoticon