Expand my Community achievements bar.

Using ASP persisted recordset

Avatar

Level 1
Hi,

I just downloaded the flex trial, I am trying to figure out
how to stream data to the datagrid from an ASP page. My ASP page
uses the recordset persistence to save the record set to an XML.
Can you please point me to a sample that shows how to take the XML
data and populate the datagrid.



The persisted XML looks like below

- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset"
xmlns:z="#RowsetSchema">

- <s:Schema id="RowsetSchema">

- <s:ElementType name="row" content="eltOnly">

- <s:AttributeType name="ID" rs:number="1"
rs:maydefer="true" rs:writeunknown="true">

<s:datatype dt:type="int" dt:maxLength="4"
rs:precision="10" rs:fixedlength="true" />

</s:AttributeType>

- <s:AttributeType name="Title" rs:number="2"
rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">

<s:datatype dt:type="string" dt:maxLength="100" />

</s:AttributeType>

- <s:AttributeType name="Details" rs:number="3"
rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">

<s:datatype dt:type="string" dt:maxLength="536870910"
rs:long="true" />

</s:AttributeType>

<s:extends type="rs:rowbase" />

</s:ElementType>

</s:Schema>

- <rs:data>

<z:row ID="1" Title="Guest" Details="The Guest privilage
level" />

<z:row ID="2" Title="User" Details="User privilage level"
/>

<z:row ID="3" Title="Manager" Details="Manager" />

<z:row ID="4" Title="Admin" Details="Admin" />

</rs:data>

</xml>



1 Reply

Avatar

Level 3
Hi MrNDIS,



I don't know if anyone has written a public helper class to
massage a .NET dataset web service result to a format that the Flex
UI controls will render but you should be able to use a function to
preprocess the result before it is bound to a UI control.



Take a look at this overview of data formats for the UI
controls:
http://livedocs.macromedia.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Pa...



I think you'll want to reformat those <Z:row .../>
elements into something that ends up looking something like:



<dataSet>

<row>

<title>Guest</title>

<details>The Guest privlage level</details>

</row>

... additional rows here ...

</dataSet>



HTH,

Seth