Click here to Skip to main content
15,893,588 members
Home / Discussions / C#
   

C#

 
AnswerRe: Is there a way to combine 2 columsn in one field in the DataViewControl? Pin
Pete O'Hanlon22-Oct-08 9:24
mvePete O'Hanlon22-Oct-08 9:24 
GeneralRe: Is there a way to combine 2 columsn in one field in the DataViewControl? Pin
pzn3xq22-Oct-08 9:40
pzn3xq22-Oct-08 9:40 
GeneralRe: Is there a way to combine 2 columsn in one field in the DataViewControl? Pin
Pete O'Hanlon22-Oct-08 9:54
mvePete O'Hanlon22-Oct-08 9:54 
GeneralRe: Is there a way to combine 2 columsn in one field in the DataViewControl? Pin
leckey22-Oct-08 14:33
leckey22-Oct-08 14:33 
QuestionHow to redirect someone to another page after inserting a record in the "DetailViewControl? Pin
pzn3xq22-Oct-08 5:46
pzn3xq22-Oct-08 5:46 
AnswerRe: How to redirect someone to another page after inserting a record in the "DetailViewControl? Pin
Simon P Stevens22-Oct-08 5:50
Simon P Stevens22-Oct-08 5:50 
AnswerCP IGNORE: habitual cross poster Pin
leckey22-Oct-08 7:32
leckey22-Oct-08 7:32 
Questionenum use in combobox Pin
Deresen22-Oct-08 5:04
Deresen22-Oct-08 5:04 
Hey everyone,

I'm trying to use an enum. But I don't use this a lot and I'm now at a point where I don't understand it anymore.

I have this code:
enum frequency
{
     Second,
     Minute,
     Hour,
     Day,
     Month,
     Year
}

public constructor()
{
       comBoxFrequency.Items.Add(frequency.Second);
       comBoxFrequency.Items.Add(frequency.Minute);
       comBoxFrequency.Items.Add(frequency.Hour);
       comBoxFrequency.Items.Add(frequency.Day);
       comBoxFrequency.Items.Add(frequency.Month);
       comBoxFrequency.Items.Add(frequency.Year);
}
public void buttonClick()
{
   switch (comBoxFrequency.SelectedText)
   {
       case frequency.Second://Error: Cannot implicitly convert type '___.frequency' to 'string'
           //do something
           break;
       case frequency.Minute.ToString()://Error: A constant value is expected
           //do something
           break;
       case frequency.Hour:
           //do something
           break;
       case frequency.Day:
           //do something
           break;
       case frequency.Month:
           //do something
           break;
       case frequency.Year:
           //do something
           break;
   }
}


As you see I get two errors: Cannot implicitly convert type '___.frequency' to 'string'
And if I make a string of this: A constant value is expected

Does anyone know how to work around this problem (or what I do wrong)?
AnswerRe: enum use in combobox Pin
Mbah Dhaim22-Oct-08 5:23
Mbah Dhaim22-Oct-08 5:23 
GeneralRe: enum use in combobox Pin
Deresen22-Oct-08 5:26
Deresen22-Oct-08 5:26 
GeneralRe: enum use in combobox Pin
Mbah Dhaim22-Oct-08 5:27
Mbah Dhaim22-Oct-08 5:27 
AnswerRe: enum use in combobox Pin
Scott Dorman23-Oct-08 9:34
professionalScott Dorman23-Oct-08 9:34 
QuestionCannot cast Object returned from a Com Object in VS2008! VS2003 is working!!!! [modified] Pin
immes22-Oct-08 4:46
immes22-Oct-08 4:46 
QuestionLearne Shair Point Pin
Thaer Hamael22-Oct-08 4:45
Thaer Hamael22-Oct-08 4:45 
AnswerRe: Learne Shair Point Pin
SeMartens22-Oct-08 5:02
SeMartens22-Oct-08 5:02 
Questionconvert delimited text file into database file using 2005 C# Pin
yefeng_law22-Oct-08 4:31
yefeng_law22-Oct-08 4:31 
AnswerRe: convert delimited text file into database file using 2005 C# Pin
SeMartens22-Oct-08 4:41
SeMartens22-Oct-08 4:41 
AnswerRe: convert delimited text file into database file using 2005 C# Pin
led mike22-Oct-08 4:47
led mike22-Oct-08 4:47 
GeneralRe: convert delimited text file into database file using 2005 C# Pin
yefeng_law22-Oct-08 5:00
yefeng_law22-Oct-08 5:00 
GeneralRe: convert delimited text file into database file using 2005 C# Pin
Mark Salsbery22-Oct-08 6:15
Mark Salsbery22-Oct-08 6:15 
GeneralRe: convert delimited text file into database file using 2005 C# Pin
led mike22-Oct-08 7:10
led mike22-Oct-08 7:10 
GeneralRe: convert delimited text file into database file using 2005 C# Pin
Mark Salsbery22-Oct-08 7:17
Mark Salsbery22-Oct-08 7:17 
GeneralRe: convert delimited text file into database file using 2005 C# Pin
led mike22-Oct-08 8:20
led mike22-Oct-08 8:20 
QuestionSimple Interface Question Pin
tjh722-Oct-08 4:13
tjh722-Oct-08 4:13 
AnswerRe: Simple Interface Question Pin
SeMartens22-Oct-08 4:19
SeMartens22-Oct-08 4:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.