Convert Dataset to ordinary XML new law

xiaoxiao2021-03-06  64

Everyone knows that using the WebService passed by Dataset, Microsoft will add Schema at each node, so it cannot be compatible with J2EE, Flash, so I found a way to convert them into ordinary XML. code show as below:

Method 1: Public Class Datasettoxml: inherits system.web.ui.page

Private sub page_load (Byval e as system.EventArgs) Handles mybase.load Dim Objconn As SqlConnection Dim Strsql As String

strsql = "SELECT TOP 10 * from customers" objconn = new sqlconnection ("Connectionstring"))

DIM SDACUS NEW SQLDATAADAPTER (STRSQL, OBJCONN) DIM DSTCUST AS New DataSet ()

sdaCust.Fill (dstCust, "Customers") 'Save data to xml file and schema file dstCust.WriteXML (Server.MapPath ( "Customers.xml"), XmlWriteMode.IgnoreSchema) dstCust.WriteXMLSchema (Server.MapPath ( "Customers.xsd ")) End Sub This method is to write an XML file method 2: _ Public Function Listallrooms () AS XMLDocument

Try m_cpcoursearange.FillroomID (m_dscoursearange) 'Dim Reader As New MemoryStream

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

New Post(0)