G
Guest
Hi all!
I have a XML file that is read by a C# program.
The file looks like this:
<EMailList>
<email>[email protected]</email>
</EMailList>
<EMailList>
<email>[email protected]</email>
</EMailList>
But I want that this file look like this:
<EMailList>
<email>[email protected]</email>
<email>[email protected]</email>
</EMailList>
But, when I do that my program blows up.
The code to read the file is that:
public class COpicsXMLOperations
{
#region XMLConfigFile
static public DataSet dsOpicsSystemBuilder;
static public DataSet dsOpicsSBUsers;
#endregion
static public DataSet DS_OpicsSystemBuilder
{
get
{
if (dsOpicsSystemBuilder==null)
{
dsOpicsSystemBuilder = new DataSet();
// Creating EMailList table
DataTable dtEMailList = new DataTable("EMailList");
DataColumn dcEMail = new DataColumn("email");
dtEMailList.Columns.Add(dcEMail);
dsOpicsSystemBuilder.Tables.Add(dtEMailList);
}
return dsOpicsSystemBuilder;
}
}
private void FrmProcParam_Load(object sender, System.EventArgs e)
{
// Clear the list to avoid duplicates
clb_EMails.Items.Clear();
this.txt_Emails.Focus();
// Read the e-mails against the XML file
COpicsXMLOperations.DS_OpicsSystemBuilder.Tables.Clear();
COpicsXMLOperations.DS_OpicsSystemBuilder.ReadXml("OpicsSystemBuilder.xml");
This is the line that blows up.
The error is:
An unhandled exception of type 'System.ArgumentException' occurred in
system.data.dll
Additional information: Cannot remove a table that has existing relations.
Remove relations first.
The program '[2304] OpicsSystemBuilder.exe' has exited with code 0 (0x0).
Anybody can help me with this?
Thanks!
Eduardo
--
Eduardo de Morais Ferrari
Misys'' OPICS Project
Stefanini IT Solutions
White Plains, NY
Phone: (914) 821-2727
Cell: (914) 406-5027
(e-mail address removed)
I have a XML file that is read by a C# program.
The file looks like this:
<EMailList>
<email>[email protected]</email>
</EMailList>
<EMailList>
<email>[email protected]</email>
</EMailList>
But I want that this file look like this:
<EMailList>
<email>[email protected]</email>
<email>[email protected]</email>
</EMailList>
But, when I do that my program blows up.
The code to read the file is that:
public class COpicsXMLOperations
{
#region XMLConfigFile
static public DataSet dsOpicsSystemBuilder;
static public DataSet dsOpicsSBUsers;
#endregion
static public DataSet DS_OpicsSystemBuilder
{
get
{
if (dsOpicsSystemBuilder==null)
{
dsOpicsSystemBuilder = new DataSet();
// Creating EMailList table
DataTable dtEMailList = new DataTable("EMailList");
DataColumn dcEMail = new DataColumn("email");
dtEMailList.Columns.Add(dcEMail);
dsOpicsSystemBuilder.Tables.Add(dtEMailList);
}
return dsOpicsSystemBuilder;
}
}
private void FrmProcParam_Load(object sender, System.EventArgs e)
{
// Clear the list to avoid duplicates
clb_EMails.Items.Clear();
this.txt_Emails.Focus();
// Read the e-mails against the XML file
COpicsXMLOperations.DS_OpicsSystemBuilder.Tables.Clear();
COpicsXMLOperations.DS_OpicsSystemBuilder.ReadXml("OpicsSystemBuilder.xml");
This is the line that blows up.
The error is:
An unhandled exception of type 'System.ArgumentException' occurred in
system.data.dll
Additional information: Cannot remove a table that has existing relations.
Remove relations first.
The program '[2304] OpicsSystemBuilder.exe' has exited with code 0 (0x0).
Anybody can help me with this?
Thanks!
Eduardo
--
Eduardo de Morais Ferrari
Misys'' OPICS Project
Stefanini IT Solutions
White Plains, NY
Phone: (914) 821-2727
Cell: (914) 406-5027
(e-mail address removed)