Hi,
I am using dataset to read a xml file.
dsData.ReadXml( ConfigurationSe ttings.AppSetti ngs["xmlpath"].ToString());
i am binding this dataset to a datagrid.
Then i add a new row to dataset
DataRow dr = dsData.Tables[1].NewRow();
dr["ID"] = dsData.Tables[1].Rows.Count;
dr["Numeric-3"] = txtNumeric3.Tex t;
dr["Alpha-2"] = txtAlpha2.Text ;
dr["Alpha-3"] = txtAlpha3.Text ;
dr["English Short Name"] = txtEShort.Text ;
dr["English Full Name"] = txtEFull.Text ;
dr["French Short Name"] = txtFShort.Text ;
dr["French Full Name"] = txtFFull.Text ;
dsData.Tables[1].Rows.Add(dr);
dsData.AcceptCh anges();
And finally, i tried to save xml.
if ( File.Exists(Con figurationSetti ngs.AppSettings["xmlpath"].ToString()))
File.Delete(Con figurationSetti ngs.AppSettings["xmlpath"].ToString());
dsData.WriteXml (ConfigurationS ettings.AppSett ings["xmlpath"].ToString());
I delete existing XML file and try to create new one.
When i tried to write xml, it gives me this error.
Please advice.
Thanks in advance.
Jatin
I am using dataset to read a xml file.
dsData.ReadXml( ConfigurationSe ttings.AppSetti ngs["xmlpath"].ToString());
i am binding this dataset to a datagrid.
Then i add a new row to dataset
DataRow dr = dsData.Tables[1].NewRow();
dr["ID"] = dsData.Tables[1].Rows.Count;
dr["Numeric-3"] = txtNumeric3.Tex t;
dr["Alpha-2"] = txtAlpha2.Text ;
dr["Alpha-3"] = txtAlpha3.Text ;
dr["English Short Name"] = txtEShort.Text ;
dr["English Full Name"] = txtEFull.Text ;
dr["French Short Name"] = txtFShort.Text ;
dr["French Full Name"] = txtFFull.Text ;
dsData.Tables[1].Rows.Add(dr);
dsData.AcceptCh anges();
And finally, i tried to save xml.
if ( File.Exists(Con figurationSetti ngs.AppSettings["xmlpath"].ToString()))
File.Delete(Con figurationSetti ngs.AppSettings["xmlpath"].ToString());
dsData.WriteXml (ConfigurationS ettings.AppSett ings["xmlpath"].ToString());
I delete existing XML file and try to create new one.
When i tried to write xml, it gives me this error.
Please advice.
Thanks in advance.
Jatin
Comment