Monday, 19 May 2014

Syntax For Switch In C#.Net and VB.Net

5/19/2014 - By Pranav Singh 0

Switch statement is one of the most important statement used in programming languages. Switch statement  is used for executing data on conditional bases.



Here i will show you syntax for Switch statement used in C#.Net and VB.Net.

C#.Net
int caseSvalue = 1;
switch (caseSvalue)
{
    case 1:
        Console.WriteLine("your Case value - 1");
        break;
    case 2:
        Console.WriteLine("your Case value -  2");
        break;
    default:
        Console.WriteLine("your default case");
        break;
}

VB.Net 
Dim caseSvalue As Integer = 1
Select Case caseSvalue
       Case 1
              Console.WriteLine("your Case value - 1")
              Exit Select
       Case 2
              Console.WriteLine("your Case value -  2")
              Exit Select
       Case Else
              Console.WriteLine("your default case")
              Exit Select
End Select


About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top