Facebook

c# xml to string XmlNodeType.EndElement is null


c# xml to string XmlNodeType.EndElement is null

Categories: Uncategorized

Delete a Git branch both locally and remotely

Categories: Uncategorized

Visual Studio 2013 git, only Master branch listed

Categories: Uncategorized

dataSet.GetXml() doesn’t return xml for null or blank columns


Categories: Uncategorized

c# xml read There is an error in XML document (2, 2).

Categories: Uncategorized

C# Unable to generate temporary classes


Error: xml read c# error CS0030: Cannot convert type ‘[]’ to ‘string’

Solution:

You are running into a known problem in XmlSerializer Code Generation component: it cannot handle some cases of nested unbounded elements.  The Object Model it creates is not valid: user cannot use it to produce xml messages.

Unfortunately to fix this you have to edit your schema to make sure that all array-like constructs will be handled properly.

 

You would need to slightly modify all schema constructs that have the following:

<xs:sequence maxOccurs=”unbounded”>

  <xs:element ../>

<xs:sequence>

 or

<xs:sequence>

  <xs:element maxOccurs=”unbounded”/>

<xs:sequence>

 

 

Have to be changed to

 

<xs:sequence maxOccurs=”unbounded”>

  <xs:element ../>

<xs:sequence>

<xs:attribute name=”tmp” type=”xs:string” />

And

<xs:sequence>

  <xs:element maxOccurs=”unbounded”/>

<xs:sequence>

<xs:attribute name=”tmp” type=”xs:string” />

 

Adding attribute will force XmlSerializer code generator using a class with array member and proper XmlSerialization attributes for the construct instead of an unwrapped array.

Categories: Uncategorized

Creating a custom event log under Event Viewer to log server events

Categories: Uncategorized