Solved

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

Posted on 2007-08-03
3
930 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
ID: 19628135
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
ID: 19636845
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
ID: 19637169
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Entity Framework 7 41
The Best Website Creation Tools 14 53
What namespace do I need to import? 2 25
EF5: Question about Metadata Artifact Processing 4 15
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

813 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

13 Experts available now in Live!

Get 1:1 Help Now