Professional Windows hosting from ORCS Web
    
An Unrivaled Windows Hosting Experience    
1-888-313-9421  |  webteam@orcsweb.com        
From Our Clients:
"This is why I love you guys. I am currently working with 3 other hosting services (not by my choice) and you are the only ones to alert its clients as to this threat. Keep up the great work!"

Join our community of clients at: 1-888-313-9421

Fill A DataGrid From An XML File
By Brad Kingsley
October 3, 2001

The code below demonstrates how to populate an ASP.Net DataGrid control with the contents of an XML file.

    <%Page Language="VB" Trace="false"%> 
    <%@Import Namespace="System.Data"%>
    <script language="VB" runat="server"> 
    Sub Page_Load(Src as Object, E as EventArgs)
    Dim oDataSet As DataSet = New DataSet 
    
    oDataSet.ReadXml("C:\GridTest\authors.xml",XmlReadMode.ReadSchema)
    
    oGrid.DataSource=oDataSet 
    oGrid.DataBind() 
    End Sub 
    </script> 
    <html>
    <head> 
    <title>Fill A DataGrid From An XML File</title>
    </head> 
    <body> 
    <asp:DataGrid id="oGrid" runat="server"
    </body> 
    </html> 
    <p/> 
    </html> 
    

~Brad

Brad Kingsley is founder and president of ORCS Web, Inc. - a company that provides managed hosting solutions for clients who develop and deploy their applications on Microsoft Windows platforms. Services include shared hosting, dedicated hosting, and webfarm hosting, with specialty in .Net, SQL Server, and architecting highly scalable solutions.

Copyright © 1996-2010 ORCS Web, Inc. All rights reserved.