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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:10:44+00:00 2026-05-23T12:10:44+00:00

i am making wcf rest service using linq. i wanna use stored procedure to

  • 0

i am making wcf rest service using linq. i wanna use stored procedure to access the database in linq..i came to know to about the accessing syntax but ToList() property i m not finding in my project..can anybody suggest me the solution ?


Code : [OperationContract]
[WebGet(UriTemplate = “/CList/”)]
public CList[] GetCList()
{string strConnection = ConfigurationManager.ConnectionStrings[“HConnectionString”].ConnectionString;

    HDataContext dc = new HDataContext(strConnection);

    string strUrl = WebOperationContext.Current.IncomingRequest.UriTemplateMatch.RequestUri.ToString();

    var result = from cust in dc.tbl_Customer_Masters

                 select new CList
                 {
                     RMSID = 0,
                     CID = cust.C_Id,
                     FIRSTNAME = cust.C_First_Name,
                     LASTNAME = cust.C_Last_Name,

                 };

    return result.ToArray(); }
  • 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-23T12:10:44+00:00Added an answer on May 23, 2026 at 12:10 pm

    The ToList() method is only defined for objects that inherit from System.Linq.Enumerable or that implement the IEnumerable interface. So, you need to make sure of the following:

    1. You have a reference to the appropriate DLL in your project (it’s in System.Core, so you should have a reference by default unless you removed it).
    2. You have a using directive for the System.Linq namespace in your file.
    3. The object you’re trying to call ToList on actually inherits from System.Linq.Enumerable or implements the IEnumerable interface.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WCF/REST web service that I'm considering using Linq to SQL to
i m making wcf service for login. my code for accesssing db data using
I would like to know how to upload a file using WCF by making
I had made a service using wcf i tested it by making a project
I am making a rest service using ServiceStack (http://www.servicestack.net). I'm using the unit of
I am making a wcf rest service which will be used from mobile devices.
I am making a SOAP request using WCF to a third party service. The
I am making WCF service call using MyViewRequest view fields inside HttpPost ActionHandler. The
I want to know whether the WCF service is available or not before making
http://pastebin.com/FPkZhxAQ Hi, I am making a WCF service/client application. WCF Service is web based.

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.