Click here to Skip to main content
15,916,293 members
Home / Discussions / C#
   

C#

 
QuestionUsing Cascading DropDown Pin
LucBite26-Aug-09 5:33
LucBite26-Aug-09 5:33 
AnswerRe: Using Cascading DropDown Pin
Henry Minute26-Aug-09 6:05
Henry Minute26-Aug-09 6:05 
QuestionPrint the output of HTML Pin
Programm3r26-Aug-09 4:48
Programm3r26-Aug-09 4:48 
AnswerRe: Print the output of HTML Pin
N a v a n e e t h26-Aug-09 5:00
N a v a n e e t h26-Aug-09 5:00 
GeneralRe: Print the output of HTML Pin
Programm3r26-Aug-09 20:33
Programm3r26-Aug-09 20:33 
GeneralRe: Print the output of HTML Pin
N a v a n e e t h27-Aug-09 2:20
N a v a n e e t h27-Aug-09 2:20 
Questionchange Column type of a binded datagridview Pin
baranils26-Aug-09 4:40
baranils26-Aug-09 4:40 
Question[Solved] How to handle a null enum retrieved from web service [modified] Pin
Brian Triplett26-Aug-09 2:56
Brian Triplett26-Aug-09 2:56 
We had to update the 3rd party application to allow null values for the specific enum fields. Flushed the mid-tier cache, updated the web reference in VS, updated the code to allow null (Incident_WS.StatusType? Status;) and it works. Big Grin | :-D
-----
I'm trying to retrieve information from a web service. Some of the output parameters are enums and do not have a value in the database. How can I handle a null value in the code? I'm using C# 2008 with the 2.0 framework, if needed I can use a newer framework.

My example code (the actual web service has 9 enums):
Incident_WS.Incident_WSService ws = new Incident_WS.Incident_WSService();
Incident_WS.AuthenticationInfo auth = new Incident_WS.AuthenticationInfo();
auth.userName = "TEST";
auth.password = "WS_TEST";
ws.AuthenticationInfoValue = auth;
string Incident_Number = "INC000000007371";
Incident_WS.StatusType Status;
ws.HelpDesk_Query_Service(Incident_Number, out Status);


From the web service:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "2.0.50727.3053")]
[System.SerializableAttribute()]
[System.Xml.Serialization.XmlTypeAttribute(Namespace="urn:HPD_IncidentInterface_WS")]
public enum StatusType {
    New,
    Assigned,
    [System.Xml.Serialization.XmlEnumAttribute("In Progress")]
    InProgress,
    Pending,
    Resolved,
    Closed,
    Cancelled,
}


Thanks in advance!

modified on Wednesday, August 26, 2009 11:54 AM

AnswerRe: How to handle a null enum retrieved from web service Pin
N a v a n e e t h26-Aug-09 5:04
N a v a n e e t h26-Aug-09 5:04 
GeneralRe: How to handle a null enum retrieved from web service Pin
Brian Triplett26-Aug-09 5:08
Brian Triplett26-Aug-09 5:08 
QuestionSuggestions on how to model a simple validation program Pin
neualex26-Aug-09 2:53
neualex26-Aug-09 2:53 
AnswerRe: Suggestions on how to model a simple validation program Pin
Super Lloyd26-Aug-09 3:12
Super Lloyd26-Aug-09 3:12 
GeneralRe: Suggestions on how to model a simple validation program Pin
neualex26-Aug-09 3:48
neualex26-Aug-09 3:48 
GeneralRe: Suggestions on how to model a simple validation program Pin
Super Lloyd26-Aug-09 3:56
Super Lloyd26-Aug-09 3:56 
AnswerRe: Suggestions on how to model a simple validation program Pin
N a v a n e e t h26-Aug-09 5:20
N a v a n e e t h26-Aug-09 5:20 
QuestionRe: Suggestions on how to model a simple validation program Pin
neualex26-Aug-09 17:49
neualex26-Aug-09 17:49 
AnswerRe: Suggestions on how to model a simple validation program Pin
N a v a n e e t h26-Aug-09 18:25
N a v a n e e t h26-Aug-09 18:25 
QuestionRe: Suggestions on how to model a simple validation program Pin
neualex27-Aug-09 1:56
neualex27-Aug-09 1:56 
AnswerRe: Suggestions on how to model a simple validation program Pin
N a v a n e e t h27-Aug-09 2:23
N a v a n e e t h27-Aug-09 2:23 
GeneralRe: Suggestions on how to model a simple validation program Pin
neualex27-Aug-09 2:30
neualex27-Aug-09 2:30 
Questionproblem with data table Pin
myinstincts26-Aug-09 2:39
myinstincts26-Aug-09 2:39 
AnswerRe: problem with data table Pin
baranils26-Aug-09 4:47
baranils26-Aug-09 4:47 
Questionsyntax error...plz help me Pin
ankitjain111026-Aug-09 2:02
ankitjain111026-Aug-09 2:02 
AnswerRe: syntax error...please help me Pin
Tony Richards26-Aug-09 2:14
Tony Richards26-Aug-09 2:14 
GeneralRe: syntax error...please help me Pin
ankitjain111026-Aug-09 2:22
ankitjain111026-Aug-09 2:22 

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.