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

  • Home
  • SEARCH
  • 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 665147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:40:40+00:00 2026-05-13T23:40:40+00:00

I have a method in my web service which returns a DataView, I have

  • 0

I have a method in my web service which returns a DataView,

I have setup a proxy which talks to this service but when i make this method in the proxy

public DataView GetSales(DateTime SalesDate)
{
    ServiceClient client = new ServiceClient();
    return client.GetSalesForDay(SalesDate);             
}

I get the error “Cannot implicitly convert type ‘object[]’ to ‘System.Data.DataView’, i have tried googling this but not getting anywhere, any help would be much appreciated.

Thanks

  • 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-13T23:40:40+00:00Added an answer on May 13, 2026 at 11:40 pm

    You can’t do this – you cannot and should not return something like a DataView from a WCF service ever. A WCF service would only ever return data – not objects with behavior (DataView contains a lot of behavior – sorting, filtering, etc.).

    Instead, in your service code, do this:

    • query your database with a SqlDataReader
    • parse out the relevant info you really need (only those fields you’re really interested in) into DTO’s (Data Transfer Objects) – basically just plain objects holding nothing but the properties of a “sale” that are important to you
    • return a List from your WCF service

    Instead of doing steps 1 and 2 yourself, you could also use Linq-to-SQL, NHibernate, or any other capable ORM to handle that conversion from row/columns in the database to an object for you.

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

Sidebar

Related Questions

Background: I'm invoking a web service method which returns a JSON string. This string
I have a web service which returns something of type MyData . public class
I have a web service method in which I create a particular type of
When I call, the service's method, I have Web Service Exception happening which I
I have a Web Service with Just one Web Method that returns a boolean
If I have a web service method, e.g. [WebMethod] [XmlInclude(typeof(SportsCar)), XmlInclude(typeof(FamilyCar))] public Car[] GetCars()
I have a Web service which returns a JSON file, and I'm required to
I have a WCF REST Web Service which returns POCO entities generated by Entity
I have a web-service running on Windows Azure which returns JSON that I consume
I have written a simple WCF web service in C# which returns records from

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.