alanchinese Posted February 4, 2005 Posted February 4, 2005 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? Quote
alanchinese Posted February 4, 2005 Author Posted February 4, 2005 i noticed that there is an auto-incremental column name "alan_Id", that when you try to add a new role in the datagrid, that column is not updating.... Quote
donnacha Posted February 5, 2005 Posted February 5, 2005 Use tablestyles to determine what is and is not displayed in the datagrid. Quote Hamlet
alanchinese Posted February 5, 2005 Author Posted February 5, 2005 finally... i did me.datagrid1.datasource = me.dataset1.tables("alan").defaultview.table it works! why is it like that? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.