Click here to Skip to main content
15,913,123 members
Home / Discussions / C#
   

C#

 
AnswerRe: easy textbox question? Pin
Rob Philpott29-Nov-05 8:02
Rob Philpott29-Nov-05 8:02 
GeneralRe: easy textbox question? Pin
melanieab29-Nov-05 8:15
melanieab29-Nov-05 8:15 
QuestionWeb Service XML to DataGrid - 'System.NullReferenceException' error Pin
tabulation29-Nov-05 7:16
tabulation29-Nov-05 7:16 
AnswerRe: Web Service XML to DataGrid - 'System.NullReferenceException' error Pin
Rob Philpott29-Nov-05 8:51
Rob Philpott29-Nov-05 8:51 
GeneralRe: Web Service XML to DataGrid - 'System.NullReferenceException' error Pin
tabulation29-Nov-05 10:15
tabulation29-Nov-05 10:15 
GeneralRe: Web Service XML to DataGrid - 'System.NullReferenceException' error Pin
Rob Philpott29-Nov-05 11:32
Rob Philpott29-Nov-05 11:32 
GeneralRe: Web Service XML to DataGrid - 'System.NullReferenceException' error Pin
tabulation29-Nov-05 11:46
tabulation29-Nov-05 11:46 
GeneralRe: Web Service XML to DataGrid - 'System.NullReferenceException' error Pin
Rob Philpott29-Nov-05 22:56
Rob Philpott29-Nov-05 22:56 
Hi Thomas,

I meant were you loading the xml content into an object of class System.Xml.XmlDocument? My guess is that you are. (an alternate is to use a class hierarchy built automatically from the wsdl/schema). How are you making the Http request?

I think the problem possibly lies in the way you are navigating the document. This line:

ProdInfo = Doc.ChildNodes[1]["ProductInfo"]["ThirdPartyProductInfo"];

is going to fail because ThirdPartyProductInfo is not a child node of ProductInfo (just looking at the xml in the browser) - it is a child node of Details which is a child node of ProductInfo.

I'd argue that this isn't a good way to go about navigating around an xml document. By chaining indexers together like this, if you get the path wrong in one of them is going to return null, and when you call the next indexer on a null reference you're going to get a NullReferenceException - what I believe is happening presently. It's not clear what part failed.

Instead, you could use XmlDocument.SelectSingleNode passing it an XPath expression for the node you are seeking.

Hope that helps!


Regards,
Rob Philpott.
QuestionDatabase Directory Error Pin
TheMajorRager29-Nov-05 7:00
TheMajorRager29-Nov-05 7:00 
AnswerRe: Database Directory Error Pin
KaptinKrunch29-Nov-05 7:25
KaptinKrunch29-Nov-05 7:25 
GeneralRe: Database Directory Error Pin
TheMajorRager29-Nov-05 10:01
TheMajorRager29-Nov-05 10:01 
QuestionSockets - Intensive I/O Issues Pin
mcljava29-Nov-05 5:09
mcljava29-Nov-05 5:09 
AnswerRe: Sockets - Intensive I/O Issues Pin
leppie29-Nov-05 7:25
leppie29-Nov-05 7:25 
GeneralRe: Sockets - Intensive I/O Issues Pin
mcljava29-Nov-05 8:04
mcljava29-Nov-05 8:04 
QuestionThread Management Pin
thepolishguy29-Nov-05 5:07
thepolishguy29-Nov-05 5:07 
AnswerRe: Thread Management Pin
mcljava29-Nov-05 7:02
mcljava29-Nov-05 7:02 
QuestionServer - Multi Client Chat Problem Pin
DarkAngel78629-Nov-05 4:47
DarkAngel78629-Nov-05 4:47 
AnswerRe: Server - Multi Client Chat Problem Pin
mcljava29-Nov-05 10:15
mcljava29-Nov-05 10:15 
GeneralRe: Server - Multi Client Chat Problem Pin
DarkAngel78629-Nov-05 22:41
DarkAngel78629-Nov-05 22:41 
QuestionHow to achieve automatic sorting in a TreeView? Pin
Morrgan29-Nov-05 4:45
Morrgan29-Nov-05 4:45 
AnswerRe: How to achieve automatic sorting in a TreeView? Pin
Curtis Schlak.29-Nov-05 9:08
Curtis Schlak.29-Nov-05 9:08 
GeneralRe: How to achieve automatic sorting in a TreeView? Pin
Morrgan29-Nov-05 20:14
Morrgan29-Nov-05 20:14 
GeneralRe: How to achieve automatic sorting in a TreeView? Pin
Curtis Schlak.30-Nov-05 1:59
Curtis Schlak.30-Nov-05 1:59 
QuestionComparing 2 strings and ignoring their case Pin
hasanali0029-Nov-05 3:22
hasanali0029-Nov-05 3:22 
AnswerRe: Comparing 2 strings and ignoring their case Pin
Guffa29-Nov-05 3:34
Guffa29-Nov-05 3:34 

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.