Solved

How Do I connect Flash to a .net Webservice and show Results in a grid?

Posted on 2007-08-03
3
923 Views
Last Modified: 2013-12-16
Hi there,

We are using Flash V8 Por and a .Net 2 webserice.

In our webservice theres a call that returns a string full of XML that describes a datatable... we have tested this and it all works fine.
we are using a webservice connector in flash and on the press of a button,  passing the results of the call into a textArea, which all works fine
We are having trouble displaying the returned XML in a datagrid though. I have maanged to get the datagrid to create the required numbe rof rows but it will not show any data.
Does anyone know where I can get an example of how to display this data in a grid using a webservice or does anyone know how do to it.
This is driving us crazy, we have been at it a week so far and still can;pt make any headway. we are c# developers by the way and not flash people, so easy steps please

BB
0
Comment
Question by:badbearontour
  • 2
3 Comments
 
LVL 14

Accepted Solution

by:
dfu23 earned 500 total points
Comment Utility
have you seen this article?
http://madowney.com/blog/2004/02/20/flash-web-services-and-net-datasets/

a key thing is that Flash needs an array of objects and not one of the .NET objects like a DataTable or a DataSet. from there you should be able to do whatever you need with the data ...
0
 
LVL 7

Author Comment

by:badbearontour
Comment Utility
Hi

thanks for the lead,I'll give it a try today and get back to you

BB
0
 
LVL 7

Author Comment

by:badbearontour
Comment Utility
Cool and the Gang....

That article pointed me in the right direction..

for the purposes of a complete Answer heres a brief overview of what the solutions was

Flash doesn't recognise .net datatables serialised into a xml, in either native or typed mode
So you have to create a custom object that matches all the columns you want from the table. then create an Array of these custom objects. You iterate through the datatable filling in the details of the new array of custom objects.
Below I have cutout my code, my custom object is the JobStatus Object that has 3 fields in it, description, status, statusdate



JobStatus[] myJobsArray = null;
DataTable myData = myDataCon.getJobs(p_ID);
if (myData.Rows.Count > 0)
{
  myJobsArray = new JobStatus[myData.Rows.Count];
  int i = 0;
  foreach (DataRow dr in myData.Rows)
  {
     myJobsArray[i] = new JobStatus();
     myJobsArray[i].description = dr[0].ToString();
     myJobsArray[i].status = dr[2].ToString();
     myJobsArray[i].statusDate = dr[1].ToString();
     i++;
   }
}

Hope this helps anyone coming after me, I spent a week trawling the web and got nowhere

BB
                                                
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now