Is it possible for a wcf service to take an SQLcommand object as an input?

I'm asking this because I would like to store those command objects in appfabric cache and execute them at a later stage through a batch once a day. (to reduce the number of uneven database hits). These are pure update statements and don't return anything.


The short answer is yes. However I wouldn't recommend doing it. Instead I would just pass the query itself as a string and create the SQLCommand in the service.

This question explains how to pass an object from a client app to a WCF service; How to pass Client Objects to WCF Service

Basically if you create the SQLCommand object client side you're; 1) allocating/initializing an object 2) having that object serialized and deserialized into an equivalent object in the service.

If you pass it a string you're instead; 1) allocating/initializing a string 2) passing it to the service which allocates and initializes a SQLCommand object.

The latter is simpler and more efficient.

Need Your Help

Resize video javascript

javascript html

I need a button that will resize a video on the webpage. The button must on first click make the video bigger, and on second click make the video smaller. I understand I need a variable to keep tra...

Making SEO friendly forms

javascript jquery forms html5 seo

I am wondering if it is possible to change the way forms submit data without the use of JS or perhaps in a search engine friendly way

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.