Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / March 2005



Tip: Looking for answers? Try searching our database.

Writing all records in DataGrid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Call Me Mad - 17 Mar 2005 00:58 GMT
Is it possible to write all records in a datagrid to a database without using a
for / next loop? It seem a little combersome having to code this to step
through each record, writing them one at a time until the end is reached. What
is the point in having a multiselect Datagrid anyway?
derobinson - 18 Mar 2005 18:21 GMT
You can bind the datagrid to a dataset and send the delta packet (any
additions, deletions, or changes) back to the server. The binding takes care of
tracking the changes, so you don't have to loop through the grid.

Good luck!
Call Me Mad - 19 Mar 2005 04:02 GMT
I must be a little dense today. I am using a dataset but still can't write all
records in one operation. As a temporary solution I am using the following code
to step through each record.

    myDataSet.first();
    while(myDataSet.hasNext()) {
    myAddRemoteConnector.trigger();
    myDataSet.next();
    }
I am using a coldfusion.cfc with the following:
    <cffunction access="remote" name="addMyRecord" output="false">
        <cfargument name="keyField1" type="string" required="yes" default="">
        <cfargument name="KeyField2" type="string" required="yes" default="">
        <cfargument name="Field3" type="string" required="yes" default="">
        <cfargument name="Field4" type="string" required="yes" default="">
        <cfquery name="addMyRecord" datasource="WebCollect">
            INSERT INTO dbo.myTable
                (KeyField1,KeyField2,Field3,Field4)
            VALUES
    '#arguments.KeyField1#', '#arguments.KeyField2#', '#arguments.Field3#',
'#arguments.Field4#')
        </cfquery>
    </cffunction>
derobinson - 21 Mar 2005 03:24 GMT
That's potentially a lot of calls to your server and you probably want to
minimize those. The Update Packet (basically an XML file) is much smoother.
Flash passes just the delta, just th ethings that have changed, in the data set
back to CF. You need an XML parser to accept the packet and deal with it, but
once you write it, you've got it for all your projects. Here, take a look at
this tutorial for ideas:

http://www.macromedia.com/devnet/mx/flash/articles/delta_packet.html

Hope it helps!
Call Me Mad - 24 Mar 2005 05:58 GMT
Thank you for your reply David, I really do appreciate the help. I did play
with the RDBMSProcessor about 6 months ago with some success. Unfortunately,
tonight, trying to convert the sample code to Flash Player 7 is making me crazy
:). I'll try again tomorrow and the day after that and the day after that until
I get it right.

Thanks Again.
Tom Coleman - 24 Mar 2005 20:31 GMT
I think this tutorial is a little more up-to-date (FMX2K/AS2 style):
<http://www.macromedia.com/devnet/mx/coldfusion/articles/dc_wizard.html>

HTH,
Tom

> That's potentially a lot of calls to your server and you probably want to
> minimize those. The Update Packet (basically an XML file) is much smoother.
[quoted text clipped - 6 lines]
>
>  Hope it helps!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.