473,387 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Problem in a XML file

Hi all!

I have a XML file that is read by a C# program.
The file looks like this:

<EMailList>
<email>ed*************@misys.com</email>
</EMailList>
<EMailList>
<email>ro***********@misys.com</email>
</EMailList>

But I want that this file look like this:

<EMailList>
<email>ed*************@misys.com</email>
<email>ro***********@misys.com</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.C lear();
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
ed*************@misys.com
Nov 12 '05 #1
0 884

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Keith Dewell | last post by:
Greetings! My current job has brought me back to working in C++ which I haven't used since school days. The solution to my problem may be trivial but I have struggled with it for the last two...
12
by: SJD | last post by:
I've just read Christoph Schittko's article on XmlSerializer: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnxmlnet/html/trblshtxsd.asp . . . and very informative it is too....
15
by: Ken Allen | last post by:
I have been developing a suite of assemblies over the past couple of weeks, and this afternoon somethign started misbehaving. If I do not run the IDE and compiler the code from the command line,...
0
by: Lokkju | last post by:
I am pretty much lost here - I am trying to create a managed c++ wrapper for this dll, so that I can use it from c#/vb.net, however, it does not conform to any standard style of coding I have seen....
5
by: IkBenHet | last post by:
Hello, I use this script to upload image files to a folder on a IIS6 server: ******************* START UPLOAD.ASPX FILE ********************** <%@ Page Language="VB" Debug="true" %>
8
by: Sarah | last post by:
I need to access some data on a server. I can access it directly using UNC (i.e. \\ComputerName\ShareName\Path\FileName) or using a mapped network drive resource (S:\Path\FileName). Here is my...
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
2
by: key9 | last post by:
Hi all on last post I confused on how to organize file of class, ok ,the problem solved : should include class define head on cpp file. but this time ,still link error: strange is I put the...
0
by: anide | last post by:
Hi all I’ve some problem, I’m trying to converting a sorting algorithm from C++ to C#. In C++ I’ve compiled it using MSVC and its working properly, and in C# I’m using .NET Framework 2.0 (Visual...
4
by: Salad | last post by:
I have a situation where some, not all, users get the message "Couldn't find file "F:\AccessApps\AppName.mdw". This file is required for startup". My app the users are attempting to access is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.