ASP.NET Write to XML

xiaoxiao2021-03-06  57

Imports System.DataImports System.Data.Oledb

Public class Webform1 inherits system.web.ui.page

#Region "The code" of the web form designer "

'This call is required for the web form designer. private subinitializecomponent ()

End sub protected withevents data data as system.Web.ui.WebControls.DataGrid

'Note: The following placeholders declare are required by the web form designer. 'Don't delete or move it. Private DesignerPlaceHolderDeclaration as System.Object

Private Sub Page_init (Byval E AS System.EventArgs) Handles mybase.init 'Codegen: This method call is required by the Web Form Designer' Do not modify it using the code editor. InitializationComponent () End Sub

#End region

Private Sub Page_Load (ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myconnection As OleDbConnection Dim mydataadapter As OleDbDataAdapter Dim mydataset As DataSet Dim mydatatable As DataTable Dim mydatarow As DataRow Dim mydatacolumn As DataColumn

myconnection = New OleDbConnection ( "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = C: /Inetpub/wwwroot/my_test/data/database.mdb") mydataadapter = New OleDbDataAdapter ( "SELECT top 3 * FROM articles", myconnection ) MyDataSet = new dataset mydataadapter.fill (MyDataSet, "Articles") MyDataBle = myDataSet.tables ("Table0")

MyDataSet.WriteXml (Server.MAppath ("1.xml"), XMLWRITE.IGNORESCHEMA) MyDataSet.WriteXmlschema (Server.MAppath ("1.xsd")) End Sub

END CLASS

转载请注明原文地址:https://www.9cbs.com/read-113375.html

New Post(0)