Click here to Skip to main content
15,887,683 members
Home / Discussions / C#
   

C#

 
AnswerRe: MDI App, MenuStrip and Icon Pin
paas1-Sep-08 4:39
paas1-Sep-08 4:39 
QuestionRefresh DataGridView on BindingSource revert Pin
AndrusM31-Aug-08 6:21
AndrusM31-Aug-08 6:21 
QuestionCalling an embedded unmanaged dll Pin
jamie55031-Aug-08 2:33
jamie55031-Aug-08 2:33 
QuestionGeneric Printer class Pin
Silvyster31-Aug-08 1:47
Silvyster31-Aug-08 1:47 
QuestionProblem referencing class library in a web service Pin
dlarkin7731-Aug-08 0:54
dlarkin7731-Aug-08 0:54 
AnswerRe: Problem referencing class library in a web service Pin
#realJSOP31-Aug-08 1:11
mve#realJSOP31-Aug-08 1:11 
GeneralRe: Problem referencing class library in a web service Pin
dlarkin7731-Aug-08 2:07
dlarkin7731-Aug-08 2:07 
GeneralRe: Problem referencing class library in a web service Pin
#realJSOP31-Aug-08 2:20
mve#realJSOP31-Aug-08 2:20 
As to your problem, the only thing I can think of is that you may have to convert the enum to an int, return the int to the calling application, and let the calling app convert it back to a Product enum. Here's a function I use to go back to an enum from an integer value. It ensures that enum "value" exists within the specified enum type, thereby never returning an invalid enum value.


//--------------------------------------------------------------------------------
/// <summary>
/// Casts the specified integer to an appropriate enumerated value of the specified 
/// enum type. If all else fails, the enum will be returned as the specified default 
/// ordinal.
/// </summary>
/// <param name="value">The integer value representing an enumeration element
/// <param name="deafaultValue">The default enum value to be used if the specified 
/// "value" does not exist in the enumeration definition
/// <returns>The appropriate enum of the specified enum type</returns>
public static T IntToEnum<t>(int value, T defaultValue)
{
	T enumValue = (Enum.IsDefined(typeof(T), value)) ? (T)(object)value : defaultValue;
	return enumValue;
}
</t>


The formatting thing is a site bug.


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


GeneralRe: Problem referencing class library in a web service Pin
dlarkin7731-Aug-08 3:02
dlarkin7731-Aug-08 3:02 
GeneralRe: Problem referencing class library in a web service Pin
#realJSOP31-Aug-08 3:33
mve#realJSOP31-Aug-08 3:33 
GeneralRe: Problem referencing class library in a web service Pin
dlarkin7731-Aug-08 3:37
dlarkin7731-Aug-08 3:37 
AnswerRe: Problem referencing class library in a web service Pin
Wendelius31-Aug-08 7:02
mentorWendelius31-Aug-08 7:02 
Questionexporting excel file to database Pin
abhijitjathar31-Aug-08 0:29
abhijitjathar31-Aug-08 0:29 
AnswerRe: exporting excel file to database Pin
Natza Mitzi31-Aug-08 2:22
Natza Mitzi31-Aug-08 2:22 
AnswerRe: exporting excel file to database Pin
MumbleB31-Aug-08 7:12
MumbleB31-Aug-08 7:12 
Questionproblem with crystal report in .net2 Pin
Member 385128630-Aug-08 22:01
Member 385128630-Aug-08 22:01 
AnswerRe: problem with crystal report in .net2 Pin
Wendelius30-Aug-08 22:29
mentorWendelius30-Aug-08 22:29 
Questionwhich is better to choose? Pin
Sajjad Izadi30-Aug-08 21:42
Sajjad Izadi30-Aug-08 21:42 
AnswerRe: which is better to choose? Pin
zafersavas30-Aug-08 23:33
zafersavas30-Aug-08 23:33 
GeneralRe: which is better to choose? [modified] Pin
Sajjad Izadi31-Aug-08 1:21
Sajjad Izadi31-Aug-08 1:21 
GeneralRe: which is better to choose? Pin
N a v a n e e t h31-Aug-08 18:06
N a v a n e e t h31-Aug-08 18:06 
AnswerRe: which is better to choose? Pin
Mbah Dhaim31-Aug-08 0:24
Mbah Dhaim31-Aug-08 0:24 
GeneralRe: which is better to choose? [modified] Pin
Sajjad Izadi31-Aug-08 1:24
Sajjad Izadi31-Aug-08 1:24 
GeneralRe: which is better to choose? Pin
Mbah Dhaim31-Aug-08 1:49
Mbah Dhaim31-Aug-08 1:49 
AnswerRe: which is better to choose? Pin
#realJSOP31-Aug-08 1:12
mve#realJSOP31-Aug-08 1:12 

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.