all groups > dotnet xml > may 2005 >
You're in the

dotnet xml

group:

Export the Data to .txt file using XML in vb.net?


Re: Export the Data to .txt file using XML in vb.net? Marc Jennings
5/26/2005 12:00:00 AM
dotnet xml:
On Thu, 26 May 2005 09:32:45 -0700, hari patel via .NET 247
[quoted text, click to view]

Not sure what you mean here. there are 2 possibilities, though.
(My apologies, these examples are in C#, but the fundamentals are the
same - Also, they have not been sanity checked, purely because it is
nearly time to go home. ;o) )

1) Dataset.WriteXml("filename.txt",XmlFileMode)

or

2)
string output = "<?xml version=\"1.0\"">;
foreach(DataRow myRow in Dataset.Tables[0].Rows){
output += "<row>";
foreach(DataColumn myColumn in DataSet.Tables[0].Columns){
output += "<" + myColumn.ColumnName + ">" + _
myRow[myColumn].ToString() + "</" + myColumn.ColumnName + ">";
}
output += "</Row>";
}

then save "output" to the file.

Export the Data to .txt file using XML in vb.net? hari patel via .NET 247
5/26/2005 9:32:45 AM
hieee there,

I am in big trouble. I want to export data from Dataset or Datagrid to .txt file using XML in VB.NET and I want to do it Manually but I don't have any ideas because I am new To XML. Please help me and Reply me Soon. Thank you in Advance.

--------------------------------
From: Hari Patel

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

AddThis Social Bookmark Button