How to bind the data set of the ASP.NET in FlashMX2004:
<% @ Webservice Language = "C #" class = "test"%>
Using system;
Using system.data;
Using system.Web.services;
Using system.data.oledb;
Public Class Test: WebService
{
[WebMethod]
Public Dataset getds ()
{
DataSet DS = New Dataset ();
OLEDBCONNECTION CONN = New OLEDBCONNECTION ("provider = microsoft.jet.Oledb.4.0; data source = d: /service.mdb");
OLEDBDataAdapter Da = New OLEDBDataAdapter ("SELECT TOP 3 ID, NAME, CONTEN"
Cn.open ();
DA.FILL (DS, "Example");
CONN.CLOSE ();
Return DS;
}
}
When debugging, call the getDS method, you can get the following XML file:
XML Version = "1.0" encoding = "UTF-8"?>
xs: sequence>
xs: complexType>
xs: element>
xs: kice>
xs: complexType>
xs: element>
xs: schema>
Dataset>
Return this Dataset is the [Object Object] type. The data type of Results obtained based on WSDL is .NET Dataset, but this is not included in the data type inherent in the Flash. After a large number of tests finally found two solutions:
Method 1:
SqlConnection conn = new SqlConnection (ConfigurationSettings.AppSettings [ "ConnectionString"]); SqlDataAdapter da = new SqlDataAdapter ( "select * from BBS_ Irrigation Irrigation visiting the park _ _ posts mad", conn); DataSet ds = new DataSet (); CONN.Open (); da.fill (ds); xmldataDocument Xmldoc = New XmlDataDocument (DS);
Return XMLDoc.innerXML // This is the Dataset in XML format
Measures accepted in Flash:
MY_XML = New XML ();
My_XML.PARSE ("Here is the result you get through WebService (the XMLDoc.innerXML)" in my code ")"); then passed the result to flash, my_xml is Dataset in XML format, then you are Give it to DataGrid. OK! Try it.