1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script runat="server">
Public xmldoc As New XmlDataDocument()
Private idmodule As String = "module.xml"
Sub Page_Load(ByVal obj As Object, ByVal e As EventArgs)
Try
xmldoc.DataSet.ReadXml(idmodule)
xmldoc.DataSet.Tables(0).DefaultView.Sort = "commune ASC"
DataGrid1.DataSource = xmldoc.DataSet.Tables(0).DefaultView
DataGrid1.DataBind()
Afficher(xmldoc.DataSet)
Catch ex As Exception
End Try
End Sub
Function Afficher(ByVal Dset As DataSet)
Dim Dr As DataRow
Dim id As String
Dim nom As String ' nom
Dim commune As String ' commune
Dim classement As String ' classment
For Each Dr In Dset.Tables(0).Rows
' pour chaque ligne du dataset
nom = Dr(10).ToString() 'colonne nom
id = Dr(0).ToString()
commune = Dr(8).ToString() 'colonne commune
classement = Dr(11).ToString() 'colone classment
Dim Tr As New TableRow ' nouvelle ligne
Dim Cel_nom As New TableCell ' cellule nom
Dim Cel_commune As New TableCell ' cellule nom
Dim Cel_classement As New TableCell ' cellule nom
Cel_nom.Text = nom
Cel_commune.Text = commune
Cel_classement.Text = classement
Tr.Cells.Add(Cel_nom)
Tr.Cells.Add(Cel_commune)
Tr.Cells.Add(Cel_classement)
Me.Table1.Rows.Add(Tr)
Next
Return 1
End Function
</script>
<!--#include file="1.aspx" -->
<form id="Form1" action="" method="get" runat="server">
<asp:Table ID="Table1" border="0" CellSpacing="10" runat="server" Font-Size="12px">
</asp:Table></span>
</form>
<asp:DataGrid id="DataGrid1" runat="server"
BorderColor="black"
GridLines="Vertical"
cellpadding="4"
cellspacing="0"
width="450"
Font-Name="Arial"
Font-Size="8pt"
HeaderStyle-BackColor="#cc9966"
FooterStyle-BackColor="#cccc99"
ItemStyle-BackColor="#ffffff"
AlternatingItemStyle-Backcolor="#cccccc" />
<!--#include file="2.aspx" --> |
Partager