The Ultrashock Ultra Bundle
  • Home
  • Community
  • Forum
  • Flash
  • Flex
  • Thread
  •  
  • Previous topic
  • Next topic
Sign up to post

Flash
 Flex

  • JJSAM Author 
    • 647 
    • 0 
    • 1 
    Cf and SQL - getting Data
    JJSAM

    Last reply Aug 19 2008, 02:19 PM

    by JJSAM

    Posted: Aug 18 2008, 05:25 PM

    by JJSAM

     

Hi all,
I’m connected to SQL DB in flex and I see the table in RDS Dataview, but when I try to retrieve the data thru cfc it doesn’t show any. I checked for the data on server it is there. I don’t know wht I’m doing wrong and help is appreciated.

“test.cfc”

<cfcomponent displayname="test.cfc" hint="CFC controls all things in testReport" output="false">
     <
cffunction name="getBuyType" access="remote" returnType="query" output="false">
       <
cfquery name="BuyTypeQRY" datasource="gmpwMaster">
               
SELECT DISTINCT Buy_Type
            FROM dbo
.perseus_AdAssignment
            WHERE Buy_Type 
= 'Branding'
            
OR Buy_Type = 'InMarket'
            
ORDER BY Buy_Type
       
</cfquery>
       <
cfreturn BuyTypeQRY>
   </
cffunction>
</
cfcomponent> 
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" x="0" y="0" width="1200" height="766" creationComplete="initGap()">
    <
mx:Script>
    <!
[CDATA[
            import mx
.effects.Resize; 
            
import mx.utils.ObjectUtil;
            
import mx.controls.Alert;
            
import mx.collections.ArrayCollection;
            
import mx.rpc.events.ResultEvent;
            
import mx.rpc.events.FaultEvent;
            
import mx.controls.dataGridClasses.DataGridColumn;
            
import mx.core.*; 
            
import mx.managers.PopUpManager;
            
import mx.containers.TitleWindow;
            
import mx.core.IUIComponent;
            use namespace 
mx_internal;
            
            
[Bindable] public var xmlBuyType:XML;
            
[Bindable] public var xmlDivision:XML;
                
            private function 
initGap():void {
                cfGap
.getBuyType(); 
                
cfGap.getDivision();            
            
}
            
            
private function saveGap():void {
                
var BuyType:String; 
                var 
Division:String;
                
                if( 
cbBuyType.selectedItem.toString()=='' || cbDivision.selectedItem.toString()==''){
                    Alert
.show("Buy Type Unvalid Type")
                
}
                
else {
                    BuyType 
= cbBuyType.selectedItem.toString();
                    
Division = cbDivision.selectedItem.toString();
                
}
            }
            
public function resultBuyType(event:ResultEvent):void {
                    xmlBuyType 
= new XML(event.result);
            
}
            
public function resultDivision(event:ResultEvent):void {
                    xmlDivision 
= new XML(event.result);
            
}
        ]]
>
    </
mx:Script>
    <!--
Database Server Connection -->
    <
mx:RemoteObject id="cfGap" destination="ColdFusion" source="TDB.CFCs.test" showBusyCursor="true">
        <
mx:method name="getBuyType" result="resultBuyType(event)" fault="Alert.show(event.fault.message)"/>

</
mx:Canvas> 
  1 REPLY
 
JJSAM Author 
1  
JJSAM

got it to work. thanx.

  • 19 August 2008 02:19 PM
  •  
  •   Log in or join for free to make a comment.
 
Topic actions
  •  Share on Facebook
  •  Share on Twitter
Topic Categories
  •  Show All Topics
  •  Development
    •  Server Side
    •  Client Side
  •  Creative Software
    •  Web
    •  Video
    •  3D
    •  Illustrator
    •  Photoshop Battles
    •  Photoshop
  •  Design
    •  Typography
    •  Resources & Insight
    •  Checkpoint
  •  Career
    •  Copyright Matters
    •  Advice & issues
    •  Job Seekers
    •  Job Offers
  •  Flash
    •  UltraMath
    •  OOP
    •  Third Party Tools
    •  Open Source alternatives
    •  Data Communication
    •  Components
    •  Flex
    •  AIR
    •  Flash Lite
    •  Flash Professional
    •  Flash Newbie
    •  ActionScript
    •  XML
  •  Lounge
    •  Polls
    •  Random Chat
    •  Showcase And Critique
    •  BombShock Award Nominations
  •  Community Essentials
    •  BombShock Award Winners
    •  Tutorials
    •  Interviews
    •  News
    •  Bitmap tutorials
Popular Topics
  • Sort by: 
  • Activity
  • Views
  • Comments
  • Likes
Advertise with us
  • Your advertisement here!
  • loading
Ultrashock
  • Creative Assets
  • Community
  • Blog
  1. Home
  2. Forum
+/-
Creative Assets
  • Categories
  • Contributors
  • How to buy
Make Money
  • Commission Rates
  • Referral Program
  • Contributor Program
Community
  • Activity Feed
  • Forum
  • Profiles
About
  • Quick Tour
  • Our History
  • Banners & Logos
Support
  • Contact Ultrashock
  • Advertise with us
  • Legal Information
  •  Keep up to date
  • Flash 779  Flash
  • Audio 6,481  Audio
  • Vector 2,130  Vectors
  • Image 12,338  Images
  • Creative Assets 21,728  Assets
  • Profiles 282,751  Members
  • Topics 93,776  Topics
  • Blog 4  Blog
  • Facebook 1,679  Facebook
  • Twitter 1,163  Twitter
  • Join our FREE monthly newsletter!
  • Archive
  • Invalid email address. Please try again.
Subscribe
  • ©2012 Ultrashock LLC - All rights reserved
  • Terms of Use
  • Privacy Policy
  • Switch to dark theme
  • RSS Feeds
  • Top

©2012 Ultrashock LLC - All rights reserved

Printed on Sat, February 11, 2012 - 19:53:41