Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
GeneralOptional Parameter in C# Pin
arechno18-Jul-05 18:55
arechno18-Jul-05 18:55 
GeneralRe: Optional Parameter in C# Pin
Christian Graus18-Jul-05 19:02
protectorChristian Graus18-Jul-05 19:02 
GeneralRe: Optional Parameter in C# Pin
arechno18-Jul-05 19:27
arechno18-Jul-05 19:27 
GeneralRe: Optional Parameter in C# Pin
Christian Graus18-Jul-05 19:29
protectorChristian Graus18-Jul-05 19:29 
GeneralRe: Optional Parameter in C# Pin
DavidNohejl19-Jul-05 3:08
DavidNohejl19-Jul-05 3:08 
GeneralRe: Optional Parameter in C# Pin
Dave Doknjas19-Jul-05 16:45
Dave Doknjas19-Jul-05 16:45 
GeneralRe: Optional Parameter in C# Pin
Christian Graus19-Jul-05 16:52
protectorChristian Graus19-Jul-05 16:52 
GeneralMy XmlFile looses its tree hierarchy after saving it Pin
rudy.net18-Jul-05 15:01
rudy.net18-Jul-05 15:01 
I have been working with xml files for a while; however, now I have to work with a xml file that has several relations that are not hierarchical which makes it a bit harder to manipulate with XmlDocument so I figured I could use datasets because a dataset automatically creates all the necessary tables. So to test it out I assign a table to the datasource of a datagrid.
My problem is that when new rows are added to the datagrid, and I call my dataset's WriteXml method, the new rows are added at the root level and my file looses its original tree hierarchy.

For example, if my original xml file is as follows:
<?xml version="1.0" standalone="yes"?>
<root xmlns="http://tempuri.org/Database.xsd">
<Database>
<Positions>
<Position PositionCode="1" PositionName="Operations Supervisor" Salary="0" />
</Positions>
</Database>
</root>

Then I set the DataSource to of a datagrid to "Position" table and after adding a couple of rows, the saved file looks like:
<?xml version="1.0" standalone="yes"?>
<root xmlns="http://tempuri.org/Database.xsd">
<Database>
<Positions>
<Position PositionCode="1" PositionName="Operations Supervisor" Salary="0" />
</Positions>
</Database>
<Position PositionCode="2" PositionName="Secretary" Salary="0"/>
<Position PositionCode="3" PositionName="LazyGuy" Salary="0"/>
</root>

Note that the new rows were added in "/root" instead of in "root/Database/positions"

Please let me know if there is a way to preserve the xml tree hierarchy when using datasets.

Many thanks in advance.
GeneralGetLParam function Pin
manhuber18-Jul-05 14:56
manhuber18-Jul-05 14:56 
GeneralRe: GetLParam function Pin
Luis Alonso Ramos18-Jul-05 15:30
Luis Alonso Ramos18-Jul-05 15:30 
GeneralASP('Cache-Control') Pin
felopater18-Jul-05 14:04
felopater18-Jul-05 14:04 
GeneralStatic Objects - Stupid Question Pin
Tristan Rhodes18-Jul-05 13:53
Tristan Rhodes18-Jul-05 13:53 
GeneralRe: Static Objects - Stupid Question Pin
leppie19-Jul-05 0:27
leppie19-Jul-05 0:27 
GeneralListView and VScrollBar. Pin
93Current18-Jul-05 13:36
93Current18-Jul-05 13:36 
GeneralRe: ListView and VScrollBar. Pin
Christian Graus18-Jul-05 13:45
protectorChristian Graus18-Jul-05 13:45 
GeneralRe: ListView and VScrollBar. Pin
Jano Petras18-Jul-05 14:36
Jano Petras18-Jul-05 14:36 
GeneralSolution is very simple! Pin
93Current19-Jul-05 9:14
93Current19-Jul-05 9:14 
QuestionThis program will self destruct in 10 sec....??? Pin
WetRivrRat18-Jul-05 12:22
WetRivrRat18-Jul-05 12:22 
AnswerRe: This program will self destruct in 10 sec....??? Pin
Christian Graus18-Jul-05 13:07
protectorChristian Graus18-Jul-05 13:07 
AnswerRe: This program will self destruct in 10 sec....??? Pin
Luis Alonso Ramos18-Jul-05 15:34
Luis Alonso Ramos18-Jul-05 15:34 
GeneralSNMP Pin
palwhatsup18-Jul-05 12:13
palwhatsup18-Jul-05 12:13 
GeneralRe: SNMP Pin
leppie19-Jul-05 0:32
leppie19-Jul-05 0:32 
QuestiondeSerialization is slow why? Pin
erdsah8818-Jul-05 11:48
erdsah8818-Jul-05 11:48 
AnswerRe: deSerialization is slow why? Pin
Robert Rohde18-Jul-05 18:42
Robert Rohde18-Jul-05 18:42 
AnswerRe: deSerialization is slow why? Pin
leppie19-Jul-05 0:40
leppie19-Jul-05 0:40 

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.