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 8355047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:44:31+00:00 2026-06-09T09:44:31+00:00

I have been tasked with implementing a WCF service in VB.NET. This WCF service

  • 0

I have been tasked with implementing a WCF service in VB.NET. This WCF service will be consumed by our own .NET Windows Forms application and provide data from a SQL Server database. The data will be displayed in a third party grid (Infragistics).

Originally I was going to use ADO.NET and return a datatable or dataset from SQL within the WCF service but I have read too many articles encouraging me to stay away from returning datatables over the internet. I am not worried about the interoperability but I am worried about the size/speed of the process. This had lead me to start using linq to sql to return entities which I can pass over the internet (.dbml)

The problem:

A lot of our data comes from stored procedures, these stored procedures return result sets that are a mix-match of existing tables and therefore does not match any return type. I have imported a stored procedure that returns (Auto-generated Type) however when I try and return this type over the WCF service I get this error in the tracelog:

Type
System.Data.Linq.SqlClient.SqlProvider+SingleResult’1[benchmark_prd_colour_findResult]
cannot be serialized. Consider marking it with the
DataContractAttribute attribute, and marking all of its members you
want serialized with the DataMemberAttribute attribute. If the type
is a collection, consider marking it with the
CollectionDataContractAttribute. See the Microsoft .NET Framework
documentation for other supported types.

Please let me know what I need to be doing to be able to return the results of a stored procedure when the results don’t match any particular existing table

  • 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-06-09T09:44:33+00:00Added an answer on June 9, 2026 at 9:44 am

    Translate it to VB! (Sorry, didnt see the tag… Assumed C#)

    Build your own object – and mark this up like this:

    [DataContract]
    public class MyObject{
    
    //here go all your fields which match whats returned in your stored proc
    [DataMember]
    public String MyField;
    [DataMember]
    public int MySecondField;
    
    }
    

    Then populate this when getting the result of your stored proc

    public MyObject GetResult(){
    stored_proc_result result = factory.callProc(); //obviously replace this with whatever you use!
    MyObject obj = new MyObject{
     MyField = FieldOne,
     MySecondField = FieldTwo
    };
    return obj;
    }
    

    Then if you pass the MyObject instance in your WCF call it should work.

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

Sidebar

Related Questions

I have been tasked to create a form designer application in Windows Forms. The
I've an ASP.NET MVC 3 project and have been tasked with implementing a few
I have been tasked to add an on-line help file to a windows application.
I have been tasked with researching and implementing data warehousing for our ERP system
I have been tasked with upgrading a large web application from .net 1.1 to
I have been tasked to look after an ASP.Net WebForms application that communicates with
We have an existing ASP.NET application (WebForms) that uses home-grown authentication. We've been tasked
I have been tasked with securing the connection string in an classic ASP application
I have been tasked with automating our build process with msbuild. We have about
Say I've been tasked to architect a product that will have a browser-based front

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.