<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="XmlDataSet" %>
Untitled Page
File: Default.aspx.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.Xml;
public partial class XmlDataSet : System.Web.UI.Page
{
protected void cmdXmlToDataSet_Click(object sender, EventArgs e)
{
XmlDataDocument dataDoc = new XmlDataDocument();
dataDoc.DataSet.ReadXmlSchema("Data.xsd");
dataDoc.Load("Data.xml");
gridData.DataSource = dataDoc.DataSet;
gridData.DataBind();
}
}
File: Data.xml
49.33
43398.55
49.99
File: Data.xsd
targetNamespace="yourURI"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" >