dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Web Services returning .NET DataSet

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    9

    Web Services returning .NET DataSet

    I am having trouble with a web service that returns a .NET DataSet. I may be just plain stupid, but what I am trying to do is populate a drop down menu with rows from a category database. I have a webservice that returns the rows in a dataset, but cannot figure out how to get the information onto the stage. Any help would be appreciated. Thanks

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Location
    Pittsburgh
    Posts
    252
    Are you using mx or 2k4? I have never used .net with webservices that return a dataset but i've used flash and .net with remoting where the developer was sending me datasets from assemblies. I believe the dataset becomes a RecordSet in flash so you may need to include the RecordSet.as (mx) or the Netservices.as, providing you have the remoting components installed.

    The recordSet has methods that you can use and most of the components in mx at least can be bound to the dataset simply by saying something like:

    combobox.setDataProvider(result);

    in 2k4 it would be something more like:
    combobox.dataProvider = result;
    i believe but am not 100% sure on that.

    to illustrate how to jam through a recordset, again mx, you could create one in flash and play with it. ALl of the methods are available in the reference panel.



    Code:
    #include "RecordSet.as"
    
    var records = new RecordSet(["event_id", "title", "event_date"]);
    
    var itemToAdd = {event_id: "11523", title: "Title #1", event_date: "01/05/05"};
    records.addItem(itemToAdd);
    
    var itemToAdd = {event_id: "21427", title: "Title #2", event_date: "01/06/05"};
    records.addItem(itemToAdd);
    
    var itemToAdd = {event_id: "6152", title: "Title #3", event_date: "01/07/05"};
    records.addItem(itemToAdd);
    
    
    
    remoting_return = function(result){
    	if(result instanceof RecordSet){
    		trace('true');
    	}else{
    		trace('false');
    	}
    	cb.setDataProvider(result);
    	var len = result.getLength();
    	for(var i = 0; i < len; i++){
    		for(var prop in result.items[i]){		
    				trace(result.items[i][prop]);
    			}
    	}
    	main_obj = result;  //result object 
    }
    
    remoting_return(records);
    Hope this helps some,
    Dunc

  3. #3
    Junior Member
    Join Date
    Jun 2004
    Posts
    9
    I am using Flash MX2004. I will try the remoting and use the RecordSet. I think that I was trying to make the WebServicesCnnection do more than it was set up to do :-). Thanks very much for the help. I'll let you know if I ever get it to work. Thanks again!!!

  4. #4
    Member
    Join Date
    Jan 2004
    Posts
    43
    minimalwhite, I'm having similiar problems with a .net webservice that I'm trying to connect to. Did you ever get this resolved? Any help you can provide would be extremely helpful. Thanks so much!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center