Click here to Skip to main content
15,894,343 members
Home / Discussions / C#
   

C#

 
GeneralRe: Im lost :( - DataGrid Pin
Heath Stewart19-May-04 3:41
protectorHeath Stewart19-May-04 3:41 
QuestionHow do I ... Pin
BillAnton18-May-04 10:58
BillAnton18-May-04 10:58 
AnswerRe: How do I ... Pin
Frank Lepkowski18-May-04 11:08
Frank Lepkowski18-May-04 11:08 
AnswerRe: How do I ... Pin
Ryan Roberts18-May-04 11:10
Ryan Roberts18-May-04 11:10 
GeneralRe: How do I ... Pin
BillAnton19-May-04 5:17
BillAnton19-May-04 5:17 
AnswerRe: How do I ... Pin
Grimolfr19-May-04 8:09
Grimolfr19-May-04 8:09 
GeneralCrystal Reports with C# Question Pin
frank2118-May-04 10:48
frank2118-May-04 10:48 
Generalformatting XML problem Pin
JockerSoft18-May-04 10:15
JockerSoft18-May-04 10:15 
<code>
DataSet datas = new DataSet("DataSetName");
DataTable dataTable = new DataTable("myNewTableName");
DataRow dataRow = dataTable.NewRow();
dataTable.Rows.Add(dataRow);

for(int i = 0; i<5; i++)
{
DataColumn dataColumn = new DataColumn();;
dataColumn.ColumnName = "myColumnName"+i.ToString();
dataTable.Columns.Add(dataColumn);
dataRow["myColumnName"+i.ToString()]="myItem"+i.ToString();
}
dataTable.AcceptChanges();
datas.Tables.Add(dataTable);

dataGrid1.DataSource=dataTable;
datas.WriteXml("TestXml.xml");
</code>

This code generate the following xml file:
--------------
<?xml version="1.0" standalone="yes" ?>
<DataSetName>
<myNewTableName>
<myColumnName0>myItem0</myColumnName0>
<myColumnName1>myItem1</myColumnName1>
<myColumnName2>myItem2</myColumnName2>
<myColumnName3>myItem3</myColumnName3>
<myColumnName4>myItem4</myColumnName4>
</myNewTableName>
</DataSetName>
--------------

I need the same data to be formatted in this way:
--------------
<?xml version="1.0" standalone="yes" ?>
<myNewTableName myColumnName0="myItem0" myColumnName1="myItem1" myColumnName2="myItem2" myColumnName3="myItem3" myColumnName4="myItem4"</myNewTableName>
--------------

how can I do this?

thanks

_____________
http://members.xoom.virgilio.it/yuppygames/english/index.htm
GeneralRe: formatting XML problem Pin
Heath Stewart18-May-04 10:24
protectorHeath Stewart18-May-04 10:24 
GeneralModems and applications Pin
bouli18-May-04 8:42
bouli18-May-04 8:42 
GeneralRe: Modems and applications Pin
Heath Stewart18-May-04 9:40
protectorHeath Stewart18-May-04 9:40 
GeneralRe: Modems and applications Pin
bouli18-May-04 9:46
bouli18-May-04 9:46 
GeneralRe: Modems and applications Pin
Heath Stewart18-May-04 9:52
protectorHeath Stewart18-May-04 9:52 
GeneralRe: Modems and applications Pin
bouli18-May-04 9:54
bouli18-May-04 9:54 
GeneralRe: Modems and applications Pin
Heath Stewart18-May-04 9:59
protectorHeath Stewart18-May-04 9:59 
GeneralRe: Modems and applications Pin
bouli18-May-04 10:01
bouli18-May-04 10:01 
GeneralRe: Modems and applications Pin
Heath Stewart18-May-04 10:04
protectorHeath Stewart18-May-04 10:04 
GeneralRe: Modems and applications Pin
bouli18-May-04 10:06
bouli18-May-04 10:06 
GeneralRe: Modems and applications Pin
Heath Stewart18-May-04 10:07
protectorHeath Stewart18-May-04 10:07 
GeneralRe: Modems and applications Pin
bouli18-May-04 10:12
bouli18-May-04 10:12 
GeneralRe: Modems and applications Pin
Heath Stewart18-May-04 10:20
protectorHeath Stewart18-May-04 10:20 
GeneralRe: Modems and applications Pin
bouli18-May-04 10:25
bouli18-May-04 10:25 
GeneralRe: Modems and applications Pin
Dave Kreskowiak18-May-04 12:23
mveDave Kreskowiak18-May-04 12:23 
GeneralRe: Modems and applications Pin
Dave Kreskowiak18-May-04 9:54
mveDave Kreskowiak18-May-04 9:54 
GeneralRe: Modems and applications Pin
bouli18-May-04 9:56
bouli18-May-04 9:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.