Click here to Skip to main content
15,917,320 members
Home / Discussions / C#
   

C#

 
GeneralRe: Multiple Data Readers in C# Pin
NJdotnetdev16-Jan-15 6:38
NJdotnetdev16-Jan-15 6:38 
GeneralRe: Multiple Data Readers in C# Pin
SledgeHammer0116-Jan-15 8:28
SledgeHammer0116-Jan-15 8:28 
GeneralRe: Multiple Data Readers in C# Pin
PIEBALDconsult16-Jan-15 7:58
mvePIEBALDconsult16-Jan-15 7:58 
GeneralRe: Multiple Data Readers in C# Pin
SledgeHammer0116-Jan-15 8:34
SledgeHammer0116-Jan-15 8:34 
GeneralRe: Multiple Data Readers in C# Pin
PIEBALDconsult16-Jan-15 8:36
mvePIEBALDconsult16-Jan-15 8:36 
QuestionHow to get the value of contextExpression from xml file using Linq to xml in c# Pin
Member 1137760515-Jan-15 4:14
Member 1137760515-Jan-15 4:14 
QuestionRe: How to get the value of contextExpression from xml file using Linq to xml in c# Pin
Richard MacCutchan15-Jan-15 5:00
mveRichard MacCutchan15-Jan-15 5:00 
AnswerRe: How to get the value of contextExpression from xml file using Linq to xml in c# Pin
Richard Deeming15-Jan-15 5:06
mveRichard Deeming15-Jan-15 5:06 
Try this:
C#
XDocument document = XDocument.Parse(@"<?xml version=""1.0"" encoding=""utf-8""?>
<campaign xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns=""urn:nds:dyn:campaign:version02"" handle=""4329"" campaignId=""4329"" campaignType=""EPG"" startDateTime=""2015-01-15T10:07:51"" endDateTime=""2015-01-15T12:07:51"" lastModifiedDateTime=""2014-10-25T06:24:28"" amsEnabled=""false"">
  <contextExpression><![CDATA[(zoneId==176)&&((startTime==100)&&(endTime==1200))]]></contextExpression>
  <adContent>
    <contentInstance xsi:type=""ImageInstanceType"" language=""English"" imageType=""PNG"" height=""228"" width=""178"" epgResolution=""HD"">
      <contentInstanceRef>image.png</contentInstanceRef>
    </contentInstance>
  </adContent>
</campaign>");


XNamespace defaultNamespace = document.Root.Name.Namespace;
XName contextExpressionNodeName = defaultNamespace + "contextExpression";
XElement contextExpressionNode = document.Root.Element(contextExpressionNodeName);
string contextExpression = (string)contextExpressionNode;
Console.WriteLine(contextExpression);

// Output:
// (zoneId==176)&&((startTime==100)&&(endTime==1200))




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: How to get the value of contextExpression from xml file using Linq to xml in c# Pin
Member 1137760515-Jan-15 5:11
Member 1137760515-Jan-15 5:11 
QuestionConverting enum numeric value to ASCII in byte? Pin
TMattC14-Jan-15 8:56
TMattC14-Jan-15 8:56 
AnswerRe: Converting enum numeric value to ASCII in byte? Pin
PIEBALDconsult14-Jan-15 9:02
mvePIEBALDconsult14-Jan-15 9:02 
GeneralRe: Converting enum numeric value to ASCII in byte? Pin
TMattC14-Jan-15 9:22
TMattC14-Jan-15 9:22 
AnswerRe: Converting enum numeric value to ASCII in byte? Pin
Richard Andrew x6414-Jan-15 9:03
professionalRichard Andrew x6414-Jan-15 9:03 
GeneralRe: Converting enum numeric value to ASCII in byte? Pin
PIEBALDconsult14-Jan-15 9:06
mvePIEBALDconsult14-Jan-15 9:06 
AnswerRe: Converting enum numeric value to ASCII in byte? Pin
Rob Philpott14-Jan-15 9:51
Rob Philpott14-Jan-15 9:51 
AnswerRe: Converting enum numeric value to ASCII in byte? Pin
Daniel Pfeffer14-Jan-15 23:53
professionalDaniel Pfeffer14-Jan-15 23:53 
AnswerRe: Converting enum numeric value to ASCII in byte? Pin
BillWoodruff15-Jan-15 1:30
professionalBillWoodruff15-Jan-15 1:30 
AnswerRe: Converting enum numeric value to ASCII in byte? Pin
Nitin Gupta116-Jan-15 2:17
Nitin Gupta116-Jan-15 2:17 
QuestionLaunch Explorer from another Program and Autofill Username and Password Pin
picardy14-Jan-15 2:20
picardy14-Jan-15 2:20 
AnswerRe: Launch Explorer from another Program and Autofill Username and Password Pin
Eddy Vluggen14-Jan-15 3:00
professionalEddy Vluggen14-Jan-15 3:00 
GeneralRe: Launch Explorer from another Program and Autofill Username and Password Pin
picardy14-Jan-15 5:14
picardy14-Jan-15 5:14 
GeneralRe: Launch Explorer from another Program and Autofill Username and Password Pin
Eddy Vluggen14-Jan-15 5:20
professionalEddy Vluggen14-Jan-15 5:20 
QuestionVS2013 ASP.NET MVC, context menu for Model defaults to Add Controller? Pin
Member 1131412813-Jan-15 8:40
Member 1131412813-Jan-15 8:40 
AnswerRe: VS2013 ASP.NET MVC, context menu for Model defaults to Add Controller? Pin
Afzaal Ahmad Zeeshan13-Jan-15 10:15
professionalAfzaal Ahmad Zeeshan13-Jan-15 10:15 
GeneralRe: VS2013 ASP.NET MVC, context menu for Model defaults to Add Controller? Pin
Agent__00713-Jan-15 17:36
professionalAgent__00713-Jan-15 17:36 

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.