473,378 Members | 1,411 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

String of enumeration

MAF
How do I return the translation of an enumartion?

public enum PeriodType

{

Year,

CYear,

Season,

Month,

Week,

Hour

}

I want to pass in 0 and get Year back.
Nov 15 '05 #1
1 6239
You want to get the string version "Year", right?

string period = Enum.GetName(
typeof( PeriodType ), (PeriodType) 0 );

-c
"MAF" <mf*****@henwoodenergy.com> wrote in message
news:up**************@TK2MSFTNGP10.phx.gbl...
How do I return the translation of an enumartion?

public enum PeriodType

{

Year,

CYear,

Season,

Month,

Week,

Hour

}

I want to pass in 0 and get Year back.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Matt | last post by:
The JSP page needs to send XML request string to another JSP page when the user clicks submit button, I wonder how to get started because when user click submit button, it will send the form to...
7
by: archway | last post by:
I know you cannot have string enumerations such as: enum myStringEnum { enumItem1 = "value 1", enumItem2 = "value 2", etc } However, I was wondering whether you had ever created something...
3
by: Sanjay Pais | last post by:
I know that string/char enum is not possible in c# (.NET2.0) I need to create the equivalent of this: public enum HOW_GOOD { AWESOME = "A", GREAT= "G", NOT_TOO_BAD = "N", TERRIBLE="T" }
9
by: rsine | last post by:
I have developed a program that sends a command through the serial port to our business system and then reads from the buffer looking for a number. Everything worked great on my WinXP system, but...
3
by: moondaddy | last post by:
How can I create a public variable similar to an Enum, but rather than returning integer values it would return String values? -- moondaddy@nospam.com
6
by: Georg J. Stach | last post by:
Hello, taken I've declared an enumeration like this: enum Color{ red,green,blue }; The internal representation of Color is of type integer and it's no problem to print out their values. ...
5
by: AMP | last post by:
Hello, I want to add some variables to a string and this isnt working. textBox1.Text="'BSL version='+ bslVerHi+ bslVerLo"; What am I doing wrong? Thanks Mike
35
by: dtschoepe | last post by:
Greetings. I am working on an assignment and can't seem to get the right concept for something I'm attempting to do with enum data types. I have defined the following in my code: enum color...
0
by: =?Utf-8?B?TGFzdGJ1aWxkZXJz?= | last post by:
Hi all, I have a weird problem which has been causing me a headache for the last two days. I have to dynamicly generate a schema in memory and load it into a dataset in memory to be returned...
7
by: Hendrik Schober | last post by:
Hi, this #include <string> class test { typedef std::string::size_type size_type; static const size_type x = std::string::npos; }; doesn't compile using either VC9 ("expected constant...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.