Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7024961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:54:42+00:00 2026-05-27T23:54:42+00:00

I am doing silver-light app which is really new to me. Is it possible

  • 0

I am doing silver-light app which is really new to me.

Is it possible retrieve data by passing queries as String to wcf and retrieve the data from the db.

The query (not linq) could be anything.. like select x,y,z from A where a=..
or select Distinct name from x…

Basically a function which should take string query and retrieve it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:54:43+00:00Added an answer on May 27, 2026 at 11:54 pm

    Yes it is possible. Create a WCF method that accepts a string which is the query. For the return type, you probably have to do some more work to make it manageable. Probably you need some kind of collection of DTO objects, which requires either a very flexible design of the DTO objects or limitations on the allowed result set of the query.

    There is a discussion on returning datasets/datatables from a web service in the Can I serialize a Data Table or Data Set to transfer over a Web Service in C#? SO question.

    As @w0lf points out, there can be severe security risks that you must take into consideration. What you will be doing is to give anyone with access to your WCF service access to run arbitrary queries on your SQL server. It can be done safely, if you run those queries under a specific account on the SQL server with carefully crafted permissions. See e.g. http://data.stackexchange.com that permits SQL queries to be run – with a read-only user.

    Generally I think that it is a bad idea to supply queries as strings, but if you really neeed it, it is indeed possible.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing small Silverlight app which will allow users to Create orders. I
I'm doing FormsAuthentivcation, on a Silverlight app. When the SL app calls a WCF
I have a Silverlight Windows Phone 7 app that pulls data from a public
Assume that I have Silverlight app doing a call to a WCF service: void
I have a WCF Data Service in my web app. I added a service
I'm new in Silverlight and i am doing some tests. With my current test
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
I am evaluating options for a desktop app which needs to support both Windows
I've got a RIA silverlight 4 app with a complex data type as a
I would like use data annotations to handle validation in my Silverlight app. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.