TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Arun Kurmi
NA
104
103.5k
Enum in C#
Mar 24 2013 5:11 AM
hi Friends,
What are wrong in this Code.It will give an Exception "Input string was not in correct format"
using System;
namespace Test
{
class Program
{
enum EnumColor:
int{
Red=0,Green=1,Blue=2
};
static void Main(string[]args)
{
Console.WriteLine("Please Enter a Color Name");
int x=Convert.ToInt32(Console.ReadLine());
switch(x)
{
case (int)EnumColor.Red:
{
Console.WriteLine("Your Choise is Red");
break;
}
case (int)EnumColor.Green:
{
Console.WriteLine("Your Choise is Green");
break;
}
case (int)EnumColor.Blue:
{
Console.WriteLine("Your Choise is Blue");
break;
}
}
}
}
}
Reply
Answers (
1
)
Retrieve data Grideview when SelectedIndexChanged
sql datatable columns