Passing a query as an object

iDenTiTy

Expert Member
Joined
Apr 14, 2007
Messages
3,899
Reaction score
2
Location
Fourways (vicinity)
Passing a query as an objectin C#

Ok I have a 'rash' of a problem - referring to development..
:D

Ok..

I have created a DB.cs class which has a method for querying the database..
Call the method dbquery.

How do I pass this method 'dbquery' as an object to another app?
In this case an actionscript app called Flex Builder.

?

Alternatively, if I create a method (function) in FB (builder), called ProductInfo(), how do I pass the database query to this method through a webservice?

Please could anyone help me?

:(
 
Last edited:
I've never heard of ActionScript before but according to Wikipedia is an Adobe Scripting language, as such I assume it is unmanaged/not .NET.

So passing an "object" between the two seems impossible.

Seems to me like a web service would possibly do the trick. Call the webservice from ActionScript, and pass the PARAMETERS of the query not the query itself and return the data via XML.
 
Yes, ActionScript is not .NET at all

Best thing would be to create a web service and serialize your objects as XML back to the flash app.
 
Ok I have a 'rash' of a problem - referring to development..
:D

Ok..

I have created a DB.cs class which has a method for querying the database..
Call the method dbquery.

How do I pass this method 'dbquery' as an object to another app?
In this case an actionscript app called Flex Builder.

?

Alternatively, if I create a method (function) in FB (builder), called ProductInfo(), how do I pass the database query to this method through a webservice?

Please could anyone help me?

:(

When you query your database what is the result? A datatable/dataset? If so, you can return that in a web method for your Flash Application.
 
Yes, ActionScript is not .NET at all

Best thing would be to create a web service and serialize your objects as XML back to the flash app.

If it's not .NET how will he deserialize the object back? Surely the data resulting from the query should be XML'd and passed back to the flash app?

EDIT: Oops didn't see your second post
 
Last edited:
If it's not .NET how will he deserialize the object back? Surely the data resulting from the query should be XML'd and passed back to the flash app?

EDIT: Oops didn't see your second post

Well, when returning the serialized objects as physical XML to the ActionScript, you can quite easily transform it to any other suitable format using XSLT. That is to say if ActionScript supports XSLT, which I'm sure it should. Otherwise, just transform it with XSLT inside the Web Service and only return the appropriate XML markup that ActionScript would be able to interpret.

I love XML / XSLT! :D

EDIT: Even better, if you are using MSSQL2005 or higher, you can return the appropriate XML markup directly from the query, eliminating the need to construct objects, serialize them and then transform the serialized XML to a form suitable for ActionScript.
 
:D I'm finding Bing to be very helpful - it's Google without Google. Heck, the big G has my email, documents, calendar - why should I give it my search habits too?

Of course, it helps to have Bing set as my default search engine in FF... ;)

<thread-hijack>
"Apparently" Bing has the big G worried? I've read some good things about it's image search's ability to filter out pr0n, but now how usefull is that really :D.

Google own me to :)
</thread-hijack>
 
Top
Sign up to the MyBroadband newsletter
X