.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 >> Interview Question >> VB.Net >> Post New Question Subscribe to Interview Questions

What is the purpose of AddHandler keyword?

Posted By :Subhransu Sekhar Jena     Posted Date :October 31, 2014    Points :40   Category :VB.Net 
Addhandler associates an event with its handler at runtime.

You can also find related Interview Question to What is the purpose of AddHandler keyword?  below: 

What is the purpose of AddHandler keyword?

  
allows you to specify an event handler
shared events or events from a structure. (More...)

what is the purpose of "base" keyword in c# ?

  
There are two uses
1) used to access a base class constructor
2) used to access a base class member in the derived class. (More...)

What is the purpose of YIELD Keyword in C#?

  
The yield keyword is used in an iterator block to provide a value to the enumerator object or to signal the end of the iteration. When used the expression is evaluated and returned as a value to the enumerator object. Note the expression has to be implicitly convertible to yield type of the iterator.

It takes one of the following forms:

yield return ;
yield break; (More...)

Yield keyword in C Sharp

  
C Sharp and yield keyword

Hi,



One of the cool and yet most unknown feature of the C# is the yield keyword. The yield keyword is used in an iterator block to provide a value to the enumerator object or to signal the end of the iteration. When used the expression is evaluated and returned as a value to the enumerator object. Note the expression has to be implicitebly convertible to yield type of the iterator. Here is an example



public static IEnumerable GetIntCollectionFromString(string SomeString){ string[] val = SomeString.Split(' '); int intToAdd; foreach (string token in val) { if (int.TryParse(token, out intVal)) { yield return intVal; } else { yield break; } }}

Here since we are using the yield keyword the function will return the collection of intVal instead of the value of intVal. The statement will only return when the iteration of the loop is complete.



There are some limitation with the yield keywords.

Unsafe blocks are not allowed
Parameters to the method, operator, or accessor cannot be ref or out. (More...)

What is the main purpose of having Conversation Group?

  
It's a way of grouping all the dialogs that are used for a particular task. All the dialogs associated with processing a particular order would be grouped into a single conversation group. The conversation group is implemented as a conversation group identifier, which is included with all messages in all dialogs contained in the conversation group. When a message is received from any of the dialogs in a conversation group, the conversation group is locked with a lock that is held by the receiving transaction. For the duration of the transaction, only the thread that holds the lock can receive messages from any of the dialogs in the conversation group. This makes our order entry application much easier to write because even though we use many threads for scalability, any particular order is only processed on one thread at a time. This means we don't have to make our application resilient to problems that are caused by the simultaneous processing of a single order on multiple threads. (More...)

MONTHS_BETWEEN date function is used for what purpose?

  
MONTHS_BETWEEN is used to find the difference between two dates. (More...)

What is the use of param keyword in C#?

  
In C# param parameter allows us to create a method that may be sent to a set of identically typed arguments as a single logical parameter. (More...)

What is the use of unsafe keyword in C#?

  
In C# the value can be directly referenced to a variable, so there is no need of pointer. Use of pointer sometime crashes the application. But C# supports pointer, that means we can use pointer in C#.

The use of pointer in C# is defined as a unsafe code. So if we want to use pointer in C# the pointer must be present in the body of unsafe declaration. But pointer does not come under garbage collection.

Example:-

unsafe
{
int a, *b;
a = 25;
b = &a;
Console.WriteLine("b= {0}",b);//returns b= 25
} (More...)

What is the use of stackalloc keyword in C#?

  
In an unsafe context it is used to allocate C# array directly on the stack. (More...)

C# delegate keyword is derived form which namespace?

  
C# delegate keyword is derived form System.MulticastDelegate. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


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