Click here to Skip to main content
15,908,445 members
Home / Discussions / C#
   

C#

 
Questiontime Pin
NiloofarNoroozi31-Aug-08 10:34
NiloofarNoroozi31-Aug-08 10:34 
AnswerRe: time Pin
Dr. Emmett Brown31-Aug-08 10:54
Dr. Emmett Brown31-Aug-08 10:54 
AnswerRe: time Pin
User 665831-Aug-08 10:54
User 665831-Aug-08 10:54 
AnswerRe: time Pin
Blue_Boy31-Aug-08 12:49
Blue_Boy31-Aug-08 12:49 
AnswerRe: time Pin
Christian Graus31-Aug-08 13:04
protectorChristian Graus31-Aug-08 13:04 
GeneralRe: time Pin
Harvey Saayman31-Aug-08 20:45
Harvey Saayman31-Aug-08 20:45 
GeneralRe: time Pin
Roger Alsing31-Aug-08 22:00
Roger Alsing31-Aug-08 22:00 
GeneralRe: time Pin
Mark Churchill31-Aug-08 22:09
Mark Churchill31-Aug-08 22:09 
GeneralRe: time Pin
Kevin Marois2-Sep-08 7:23
professionalKevin Marois2-Sep-08 7:23 
AnswerGet out of programming... Pin
leckey31-Aug-08 15:34
leckey31-Aug-08 15:34 
QuestionMDI Form Menu problem in C# windows application Pin
fqn31-Aug-08 9:26
fqn31-Aug-08 9:26 
AnswerRe: MDI Form Menu problem in C# windows application Pin
Wendelius31-Aug-08 9:38
mentorWendelius31-Aug-08 9:38 
QuestionSplitting a list into seperate threads. Pin
Buckleyindahouse31-Aug-08 9:08
Buckleyindahouse31-Aug-08 9:08 
QuestionRe: Splitting a list into seperate threads. Pin
Mark Salsbery31-Aug-08 9:49
Mark Salsbery31-Aug-08 9:49 
AnswerRe: Splitting a list into seperate threads. Pin
Buckleyindahouse31-Aug-08 17:58
Buckleyindahouse31-Aug-08 17:58 
AnswerRe: Splitting a list into seperate threads. Pin
Guffa31-Aug-08 10:30
Guffa31-Aug-08 10:30 
QuestionMDI App, MenuStrip and Icon Pin
paas31-Aug-08 6:25
paas31-Aug-08 6:25 
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 
Hi,

I have a simple class library (Common.dll) that contains one public enum

public enum Product {
Deliver = 0,
Order,
MSM
}

I have a web service that uses Common.dll

<pre>[WebMethod]
public string GetProductDescription(Common.Product product) {
if(product == Common.Product.Deliver)
{
return "Deliver";
}
else if(product == Common.Product.Order){
return "Order";
}
else if(product == Common.Product.MSM){
return "MSM";
}
return string.Empty;
}</pre>

The web service compiles without problems.

I have a simple windows forms application that has a reference to Common.dll and to the web service

I have a method which calls the web service GetProductDescription

<pre>private string GetProductDescription(Common.Product product)
{
return ws.GetProductDescription(product);
}
</pre>
I get a compiler error saying "cannot convert from 'Common.Product' to 'WindowsApplication1.localhost.Product'"

I looked at the generated code for the web reference (reference.cs) and the Product enum has been defined so it seems that it is completely ignoring the enum from Common.dll

<pre>/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.3053")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://www.itutopia.net/WebSync3")]
public enum DataBaseAction {

/// <remarks/>
Insert,

/// <remarks/>
Update,

/// <remarks/>
Delete,
}</pre>

I'm pretty stumped as to what's causing this to happen so any advice or suggestions will be well appreciated.

Thanks,

dlarkin77
AnswerRe: Problem referencing class library in a web service Pin
#realJSOP31-Aug-08 1:11
professional#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
professional#realJSOP31-Aug-08 2:20 

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.