Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i have the following file called alan.xml

 

<alan>

<one>

<jump>1</jump>

<sit>2</sit>

</one>

<one>

<jump>9</jump>

<sit>2</sit>

</one>

</alan>

 

alan is the root, one is the table name, jump & sit is the column names. if i do MyDataSet.ReadXml("alan.xml"), it will have two tables, but i want to only consider table "one".

 

ok, i put a datagrid in the form, assign MyDataSet.Tables("one") to the datasource. it shows two columns in the datagrid: jump & sit. that's normal.

 

however, when i tried to do MyDataSet.WriteXml("alan.xml") after i added a new row inside the datagrid, it gives me an error which i found out it's because the column numbers of the added new row are not maching the dataset.

 

i tried to display the structure of the datatable, it has one extra column call "alan_id".

 

my question is, why didn't the datagrid show the "alan_id" column? how can i use the datagrid to change the datatable and reflect the changes in the xml file by using WriteXml?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...