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

C#

 
QuestionSelf Hosted WCF + REST + CORS Pin
evolcoder11-Jul-14 22:10
evolcoder11-Jul-14 22:10 
AnswerRe: Self Hosted WCF + REST + CORS Pin
OriginalGriff11-Jul-14 22:37
mveOriginalGriff11-Jul-14 22:37 
AnswerRe: Self Hosted WCF + REST + CORS Pin
Rob Philpott11-Jul-14 22:39
Rob Philpott11-Jul-14 22:39 
GeneralRe: Self Hosted WCF + REST + CORS Pin
evolcoder14-Jul-14 17:16
evolcoder14-Jul-14 17:16 
Questionexe of C# file. Pin
Mehmood Ali Biswas11-Jul-14 21:36
Mehmood Ali Biswas11-Jul-14 21:36 
AnswerRe: exe of C# file. Pin
OriginalGriff11-Jul-14 22:36
mveOriginalGriff11-Jul-14 22:36 
AnswerRe: exe of C# file. Pin
Rob Philpott11-Jul-14 22:37
Rob Philpott11-Jul-14 22:37 
QuestionImport XML file without stylesheet Pin
Richard.Berry10011-Jul-14 19:01
Richard.Berry10011-Jul-14 19:01 
Hi
I need to populate a datatable with two fields from an xml file.<partnum> and <actualqtynum>

The file was obtained from a report that opens in a web browser, and the file saved from there.

C#
DataTabel.ReadXml(XMLFilename)
fails (complains about the ':' character in Line 2 of the xml file.)

I thought about using something like below, since I do have a complete list of the <partnum> in another table, but the <actualqtynum> is not a child node of <partnum> , and this also fails (complains about the ':' character in Line 2 of the xml file.)

C#
public string GetKeyValue(string key)
       {
           System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
           xd.Load(_XMLFileName);
           System.Xml.XmlNode Node = xd.DocumentElement.SelectSingleNode("/REPORTTABLE/REPORTTABLEDETAILS/PARTNUM add[@key=\"" + key + "\"]");

           if ((Node != null))
           {
               return Node.Attributes.GetNamedItem("value").Value;
           }
           else
           {
               return null;
           }
       }


Any idea how I can get a list of PARTNUM with the corresponding ACTUALQTYNUM?

XML
<?xml version="1.0" encoding="Shift_JIS" ?>
<?xml:stylesheet type="text/xsl" href="../Bin/KITSCHREPFLEXA.xsl" ?>
<DOCUMENT>
<REPORTHEADER>
<REPORTTIME>2014/07/11 13:36:44</REPORTTIME>
<CREATEBY>Fujiuser</CREATEBY>
<SCHEDULENAME>Week_23_2014</SCHEDULENAME>
</REPORTHEADER>
<REPORTTABLE>
<REPORTTABLEDETAILS>
<JOBNAMES><JOBNAME>260-C536000-PACE - Top_TLine 1 / Line 1 / Top / 1</JOBNAME></JOBNAMES>
<JOBNAMES><JOBNAME>260-C536000-PACE - Top_BLine 2 / VEK Line 2 / Bottom / 1</JOBNAME></JOBNAMES>
<DATANUM>38</DATANUM>
<PARTBARCODE>938-1030507</PARTBARCODE><ORIGINALPARTBARCODE>938-1030507</ORIGINALPARTBARCODE><PARTNUM>938-1030507</PARTNUM>
<SUPPLYNUM>2</SUPPLYNUM>
<ACTUALNUM>2</ACTUALNUM>
<REMAINSNUM>0</REMAINSNUM>
<QTYSUPPLYNUM>4</QTYSUPPLYNUM>
<QTYACTUALNUM>6249</QTYACTUALNUM>
<QTYREMAINSNUM>6245</QTYREMAINSNUM>
</REPORTTABLEDETAILS>
<REPORTTABLEDETAILS>
<DATANUM></DATANUM>
<PARTBARCODE>948-1025627</PARTBARCODE><ORIGINALPARTBARCODE>948-1025627</ORIGINALPARTBARCODE><PARTNUM>948-1025627</PARTNUM>
<SUPPLYNUM>2</SUPPLYNUM>
<ACTUALNUM>1</ACTUALNUM>
<REMAINSNUM>-1</REMAINSNUM>
<QTYSUPPLYNUM>40</QTYSUPPLYNUM>
<QTYACTUALNUM>6720</QTYACTUALNUM>
<QTYREMAINSNUM>6680</QTYREMAINSNUM>
</REPORTTABLEDETAILS>

SuggestionRe: Import XML file without stylesheet Pin
Richard MacCutchan11-Jul-14 21:35
mveRichard MacCutchan11-Jul-14 21:35 
GeneralRe: Import XML file without stylesheet Pin
Richard.Berry10012-Jul-14 18:17
Richard.Berry10012-Jul-14 18:17 
GeneralRe: Import XML file without stylesheet Pin
Bernhard Hiller13-Jul-14 21:40
Bernhard Hiller13-Jul-14 21:40 
QuestionError : Method name expected // how do I fix this error. please Pin
Member 1074342211-Jul-14 17:47
Member 1074342211-Jul-14 17:47 
AnswerRe: Error : Method name expected // how do I fix this error. please Pin
Richard.Berry10011-Jul-14 19:19
Richard.Berry10011-Jul-14 19:19 
SuggestionRe: Error : Method name expected // how do I fix this error. please Pin
Richard MacCutchan11-Jul-14 21:36
mveRichard MacCutchan11-Jul-14 21:36 
QuestionWhy Sql server don't convert dateformat (dd-mm-yyyy) or (yyyy-dd-mm) ? Pin
arvind mepani11-Jul-14 4:42
arvind mepani11-Jul-14 4:42 
AnswerRe: Why Sql server don't convert dateformat (dd-mm-yyyy) or (yyyy-dd-mm) ? Pin
Retro61711-Jul-14 5:11
Retro61711-Jul-14 5:11 
AnswerRe: Why Sql server don't convert dateformat (dd-mm-yyyy) or (yyyy-dd-mm) ? Pin
Richard MacCutchan11-Jul-14 5:19
mveRichard MacCutchan11-Jul-14 5:19 
AnswerRe: Why Sql server don't convert dateformat (dd-mm-yyyy) or (yyyy-dd-mm) ? Pin
Richard Deeming11-Jul-14 5:21
mveRichard Deeming11-Jul-14 5:21 
AnswerRe: Why Sql server don't convert dateformat (dd-mm-yyyy) or (yyyy-dd-mm) ? Pin
OriginalGriff11-Jul-14 5:55
mveOriginalGriff11-Jul-14 5:55 
AnswerRe: Why Sql server don't convert dateformat (dd-mm-yyyy) or (yyyy-dd-mm) ? Pin
Bernhard Hiller13-Jul-14 21:45
Bernhard Hiller13-Jul-14 21:45 
QuestionILnumerics illustrate 3D coordinates Pin
gzax11-Jul-14 3:47
gzax11-Jul-14 3:47 
AnswerRe: ILnumerics illustrate 3D coordinates Pin
OriginalGriff11-Jul-14 3:56
mveOriginalGriff11-Jul-14 3:56 
QuestionCrystal Report Runtime command line Pin
Amr Muhammed11-Jul-14 3:33
Amr Muhammed11-Jul-14 3:33 
AnswerRe: Crystal Report Runtime command line Pin
Eddy Vluggen11-Jul-14 7:16
professionalEddy Vluggen11-Jul-14 7:16 
QuestionPass byte.TryParse() or int.tryParse() as argument Pin
Mc_Topaz11-Jul-14 1:03
Mc_Topaz11-Jul-14 1:03 

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.