.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Write XML files from DataSet

Posted By:      Posted Date: August 31, 2010    Points: 0   Category :ASP.Net
How can i write complex XML from a dataset? I use DataSet.writexml, and it returns simple XML. If i write out the schema, using DataSet.WriteXmlSchema, the schema is correct and the same as the XSD.   Example (DataSet.WriteXmlSchema)   <?xml version="1.0" standalone="yes" ?> - <xs:schema id="ISEFTSessionLoginRequest" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xs:element name="ISEFTSessionLoginRequest" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"> - <xs:complexType> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="Envelope"> - <xs:complexType> - <xs:sequence>   <xs:element name="Username" type="xs:string" minOccurs="0" />   <xs:element name="Password" type="xs:string" minOccurs="0" />   <xs:element name="ClientVersion" type="xs:string" minOccurs="0" />   <xs:element name="ClientTrackNum" type="xs:string" minOccurs="0" />   <xs:element name="SessionId" type="xs:string" minOccurs="0"

View Complete Post

More Related Resource Links

How to read/write files > 2GB ?

I need to read very large NTFS files (> 2GB in length).  But Filestream.Read/Write only supports 32-bit int offset and count values (unless there's an overload I can't find) How can I avoid having to read these files in 2GB "chunks" and then manually re-compose the file from the chunks? Or should I be using an alternative to Filestream that supports reads/writes > 2GB?   What??? Thanks! DT

Querying a dataset filled from xml files

I am writing an application in vb.net 2008 to extract multiple xml files selected from a destined folder. App has managed to select a folder, then it reads each xml file one by one inset the data in dataset. After the app inserts xml into dataset I want to establish relationship among tables created in the data set. For more info xml has this strucure: <RedLionHeder> <Customer> <Site> <Meter1> <Meter2>......<Metern> <Channel1> <Channel2>.....<Channeln> So I want to establish relationship as Each file will have 1 customer, 1 or many sites, each site will have more than 1 meters and each meters will have more than 1 channels. If any one help me in this I would appreciate. Please not the xml files are of the size of 80 to 90Kb therefore it contains lot of data. Here is the code: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click        'Open the Folder Browser Dialog         'Dim dsOutput As New Data.DataSet        Dim fb As New FolderBrowserDialog        Dim count As Integer        With fb             .ShowDialo

write server side code in External JS files

Salam To All,for my JS code, some times i need to organize my code, so i prefer to put some of javascript functions in external js files and  include it in my page as well.but i am face a problem if i need to write some .Net code especially to Get the Client ID for any of .net controls.so do you have a way to write the following code in External JS file?('#<%= this.ddlMake.ClientID %>').change(function(

Write XML from dataset


hi all forum

  I am using a dropdownlist(ddl) and i bind it to an object datasource which gets data from countries datatable and I use the CountryId as the value field and the country as  datafield.

Now I want to bind my ddl to an xml data source.

I used the following C# code to generate an xml file from my datatable

XmlDocument MyXml = new XmlDocument();
        XmlElement myElement = MyXml.CreateElement("Countries");
        string filename = Request.PhysicalApplicationPath + "XmlData/Countries.xml";
        if (File.Exists(Request.PhysicalApplicationPath + "XmlData/Countries.xml"))
            File.Delete(Request.PhysicalApplicationPath + "XmlData/Countries.xml");

How to write XML files locally..



    I am develpoing an application in Web. I want to create a web method that returns a Dataset. I have 2 XML Files  that is there in my server and i want to write both the XML files in my local computer. I wanted to do using web method and i wanted to do it in a single web method call. How to do it? I am using VS2005.


Problem with security on ISS?, why can i write HTML file but not XML files


hi guys

I have a web app the manages articles, users can generate articles which we store in the database and also in a folder inside the application in html.  We also have the ability to generate real time alerts, to targetted audiences but the list of audiences was cached from an sql query on the web server and at times, the cache was cleared by the server. so i wrote an http module, and the module now runs the query using a timer, and this then wrties the audiences to an xml file within a folder in the same application (same as my html files)

Now the weird thing is im getting the system.io unauthorised access exception, when i try to delete and overwrite the xml file.  Yet this doesnt happen when i write the html files.

Now although my users do login, there credentials are maintained via an sql database table, not windows security or the asp.net security model. 

Ive checked the folder that we publish our applications up to (its a mapped folder like a virtual directory), and i cannot see the network service or asp.net machine accounts usually used in iis5 or 6.  But i dont have the ability to change this anyway. 

Why would the html file write fine, and the xml file throw this error. 

I also changed my code to used HttpRuntime.AppDom

How to write the manifest file for Reg-Free COM if there are two DLL files? ( 32-bit and 64-bit vers



Our program, Core.exe is using two different COM dll files for 32-bit and 64-bit OS. 

Normally, the user will be required to register either one of the dll files using 'regsvr32' command in Command Prompt window.

However we decided to use Reg-Free COM using a manifest file Core.exe.manifest located alongside Core.exe.

The problem is, now we have two DLL files, 32bit.dll and 64bit.dll.. how do we configure the manifest file?

For example if there's only one dll file, my manifest file should look like:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
 <file name="32bit.dll">
  <comClass clsid="{9DFC3817-ACDA-4BB4-C74B-6507DF3A25E5}"
       description="Some Class"

Since the 64bit.dll is using the same clsid, tlbid and all.. is it possible to specify two file names in the 'file name' field above? not sure how to handle this..



Best Regards,

Send group of files within dataset to WCF


hi iam sending data using a dataset and inside this dataset i have more than one datatable , and in one datatable i have more than one file rows, when i accept the dataset in the wcf and begin to add the data to the wcf database when it reaches to the file an error occures saying unable to chnage from string to array of byte

so what i want is how IN CODE  plz to send the file- i dont want to sen dit alone , it must be kept within the datatable  -maybe change it to other format- and i need also how to get it back from the wcf

plz if u can -dont tell me to serialize or do that - plz if u can write me some code i will be thankful .

and thanx in advance

How to write Dataset to Xml manually without using ds.writexml() ?

Hi, How to write Dataset to Xml manually without using ds.writexml() ?

Merge two .sdf databases files, and SqlCeDataAdapter.Update(dataset) not working,

Hello You'll, I have two .sdf databases that I need to merge them. So, I loaded the data from the two files into datasets and then called the dataset.merge()function. Now, I have the merge dataset ready but I am not sure how I am going to update the sdf file from the dataset. Please help I have been trying for a while . The problem is how do I get the data in the dataset into the sdf file. I did use the SqlCeDataAdapter.update(Dataset) but I am getting the following error (" Update unable to find TableMapping['Table'] or DataTable 'Table') using VS 2010 and C# SqlCE 3.5, Thanks in advance, Sean

Clean Web.Config Files (VS 2010 and .NET 4.0 Series)

.NET 4 includes a new version of the CLR, and a new .NET 4 specific machine.config file (which is installed side-by-side with the one used by .NET 2, .NET 3 and .NET 3.5).

The new .NET 4 machine.config file now automatically registers all of the ASP.NET tag sections, handlers and modules that we've added over the years, including the functionality for:

.ASP.NET Dynamic Data
.ASP.NET Routing (which can now be used for both ASP.NET WebForms and ASP.NET MVC)
.ASP.NET Chart Control (which now ships built-into ASP.NET V4)
What this means is that when you create a new "Empty ASP.NET application" project in VS 2010, you'll find that the new default application-level web.config file is now clean and simple:

Introducing ADO.NET and the Typed DataSet

In reviewing the applications it seemed everything they were doing involved database reads, writes, and manipulation. The development staff had been reviewing the articles and code samples for ADO.NET. They had spent many years refining their existing ADO based infrastructure and perfecting their use of ADO

Create and Use a Typed DataSet by Using Visual C# .NET

This article shows you how to create and use a typed DataSet in a small Web application. Typed DataSets, which inherit from the DataSet class, create first-class members of a DataSet's DataTables and DataColumns, yielding the many benefits that come with the use of strong typing.

Write Custom WebParts for SharePoint 2007

The popularity of SharePoint Portal Server 2003 led Microsoft to tightly integrate the next SharePoint version, Microsoft Office SharePoint Server (MOSS) 2007, with its ASP.NET 2.0 WebPart framework. This tight integration enables the ASP.NET and SharePoint developer to do a number of things that previously weren't possible

SharePoint document migration challenges when migrating files and folders

There are several challenges when migrating documents to Microsoft SharePoint. While these challenges can be overcome, they are a real pain if the migration source, content and file systems are not SharePoint friendly.

Combine, minify and compress JavaScript files to load ASP.NET pages faster

Websites are getting more interactive these days and most of this interactivity comes from JavaScript. People are using different JavaScript libraries and frameworks to make their websites more interactive and user friendly.

Get Top 1 Record from Dataset

Many of them in need of getting the Top 1 or Top 10 records from a Dataset without going to SQL query. It is possible to do from Code Behind. I have given the code below,
The below code is to get single record from a Dataset. Also I have given for getting 8 records at Green Color.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend